Exemplo n.º 1
0
        /// <summary>
        /// Construct a turn processor.
        /// </summary>
        public TurnGenerator(ServerData serverState)
        {
            this.serverState = serverState;
            turnSteps        = new SortedList <int, ITurnStep>();
            rand             = new Random();

            // Now that there is a state, comopose the turn processor.
            // TODO ??? (priority 4): Use dependency injection for this? It would
            // generate a HUGE constructor call... a factory to
            // abstract it perhaps? -Aeglos
            orderReader        = new OrderReader(this.serverState);
            battleEngine       = new BattleEngine(this.serverState, new BattleReport());
            bombing            = new Bombing(this.serverState);
            checkForMinefields = new CheckForMinefields(this.serverState);
            manufacture        = new Manufacture(this.serverState);
            scores             = new Scores(this.serverState);
            intelWriter        = new IntelWriter(this.serverState, this.scores);
            victoryCheck       = new VictoryCheck(this.serverState, this.scores);

            turnSteps.Add(SCANSTEP, new ScanStep());
            turnSteps.Add(BOMBINGSTEP, new BombingStep());
            turnSteps.Add(STARSTEP, new StarUpdateStep());
        }
Exemplo n.º 2
0
 public Scores(ServerData serverState)
 {
     this.serverState = serverState;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new battle engine.
 /// </summary>
 /// <param name="serverState">
 /// A <see cref="ServerState"/> which holds the state of the game.
 /// </param>
 /// <param name="battleReport">
 /// A <see cref="BattleReport"/> onto which to write the battle results.
 /// </param>
 public BattleEngine(ServerData serverState, BattleReport battleReport)
 {
     this.serverState = serverState;
     this.battle      = battleReport;
 }
Exemplo n.º 4
0
 public CheckForMinefields(ServerData serverState)
 {
     this.serverState = serverState;
 }
Exemplo n.º 5
0
 public Manufacture(ServerData serverState)
 {
     this.serverState = serverState;
 }
Exemplo n.º 6
0
 public Bombing(ServerData serverState)
 {
     this.serverState = serverState;
 }
Exemplo n.º 7
0
 public SimpleTurnGenerator(ServerData serverState) : base(serverState)
 {
 }
Exemplo n.º 8
0
 public VictoryCheck(ServerData serverState, Scores scores)
 {
     this.serverState = serverState;
     this.Scores      = scores;
 }
Exemplo n.º 9
0
 public IntelWriter(ServerData serverState, Scores scores)
 {
     this.serverState = serverState;
     this.scores      = scores;
 }