Esempio n. 1
0
        protected void MemorizeTurn(Turn turn)
        {
            if (Turns.Last == null)
            {
                Turns.AddLast(turn.Copy());
                return;
            }
            var currentTurn = Turns.Last.Value;

            if (turn.Type != Turn.Types.None && turn.Type != Turn.Types.MoveLeft && turn.Type != Turn.Types.MoveRight ||
                currentTurn.Type != turn.Type)
            {
                Turns.AddLast(turn.Copy()); // copy to not increase counter from outside
            }
            else
            {
                currentTurn.Repetitions++;
            }
        }