
import Pkg
psg = "C:/Users/dusty/Documents/PlaymatProjects/PlaymatSimulator"
gd = "C:/Users/dusty/Documents/PlaymatProjects/PlaymatGames/Mage"
Pkg.activate(psg)

using Colors
using Serialization
using PlaymatSimulator

"""
Elder Dragon Highlander aka Commander
EDH is a variant of an MtG game that uses a 100 card singleton deck with 1 or more cards designated as the "Commander" and a 40 point lifepool. The Commander should start on the battlefield and be visible to all players.
"""

USER_SETTINGS = deserialize("C:/Users/dusty/Documents/PlaymatProjects/PlaymatSimulator/tmp/user_selection.jls")
const GAME_NAME = USER_SETTINGS[:GAME_NAME]
const DECK_NAME = USER_SETTINGS[:DECK_NAME]

game_include("$gd/Base/notebooks/Base.jl")

game_include("$gd/Base/notebooks/game_settings.jl")

game_include("$gd/Base/notebooks/game_rules.jl")

game_include("$gd/$GAME_NAME/game_state.jl")

merge!(gs, USER_SETTINGS)
deck = deserialize("$gd/$GAME_NAME/decks/$DECK_NAME/$DECK_NAME.jls")
gs[:deck] = deck

add_texts!(gs)

reset_stage!(gs)

# required GameOne variables
const SCREEN_HEIGHT = gs[:SCREEN_HEIGHT]
const SCREEN_WIDTH = gs[:SCREEN_WIDTH]

play_music(gd * "/Base/music/chad_crouch_-_moonrise.mp3", 1)  # play_music(name, loops=-1)

PlaymatSimulator.GameOne.SDL2.ShowCursor(Int32(0))  # hides system mouse cursor