Represents battle field where snakes are trying to eat each other.
Inheritance: IBattleField
        public dynamic PlayBattle()
        {
            dynamic repository = new ExpandoObject();

            IBattleField battleField = new BattleField();
            List<Snake> snakes = GetSnakes();

            dynamic battle = new Battle(battleField, snakes); //battle.Create(battleField, snakes);
            dynamic battleReplay = battle.PlayToEnd();

            repository.Save(battle);
            repository.Save(battleReplay);

            return battleReplay.ToJson();
        }
Example #2
0
 internal void PutOnBattleField(BattleField battleField)
 {
     this.battleField = battleField;
 }