Ejemplo n.º 1
0
 private GameEngine()
 {
     ArmyFactory    = new StandardArmyFactory();
     _firstArmy     = ArmyFactory.GetArmy(0);
     _secondArmy    = ArmyFactory.GetArmy(0);
     CommandInvoker = new Invoker();
 }
Ejemplo n.º 2
0
        public void NewGame(int cost, string first = "First Army", string second = "Second Army")
        {
            IArmyFactory armyFactory = new StandardArmyFactory();

            _firstArmy       = armyFactory.GetArmy(cost);
            _firstArmy.Name  = first;
            _secondArmy      = armyFactory.GetArmy(cost);
            _secondArmy.Name = second;
            AddObservers();

            IsDeadHeat = false;
            _random    = new Random();
            SetStrategy(StrategyTypes.OneToOne);
        }