package game

import (
	"io"

	"tetris/game/config"
)

// Global config variable with default values.
var Config = &config.Config{
	SoundVolume: 255,
}

func LoadConfig(configPath string) error {
	cfg, err := config.LoadFromFile(configPath)
	if err != nil && err != io.EOF {
		return err
	}
	Config = cfg
	return nil
}
