public void StartLevel(LevelState levelState)
 {
     currentLevel = levelState;
     showingWinScreen = null;
     if (levelState != null)
     {
         gameStates = new List<GameState>();
         GameState newState = new GameState(levelState.script);
         gameStateOnSkip = newState.GetGameStateOnSkip();
         gameStates.Add(newState);
         selectionState = new UISelectionState(newState);
     }
 }
        public void PlayTurn(Card c, Minion caster, TriggerItem target)
        {
            if (c.effect != null && c.effect is Effect_Rewind)
            {
                if (gameStates.Count <= 1)
                    return;
                // rewind isn't really a spell like everything else
                gameStates.RemoveAt(gameStates.Count - 1);
                gameStateOnSkip = gameStates.Last().GetGameStateOnSkip();
                selectionState = new UISelectionState(gameStates.Last());
            }
            else
            {
                GameState oldGameState = gameStates.Last();
                if (oldGameState.CanPlayCard(c, target))
                {
                    nextGameState = new GameState(gameStates.Last());

                    animation.Clear();
                    if (caster == null)
                        caster = nextGameState.wizard;

                    nextGameState.PlayCard(c, caster, nextGameState.Adapt(target), animation);
                    nextGameState.TurnEffects(animation);

                    gameStateOnSkip = nextGameState.GetGameStateOnSkip();
                }
            }
        }