예제 #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());
        }
예제 #2
0
 public VictoryCheck(ServerData serverState, Scores scores)
 {
     this.serverState = serverState;
     this.Scores      = scores;
 }
예제 #3
0
 public IntelWriter(ServerData serverState, Scores scores)
 {
     this.serverState = serverState;
     this.scores      = scores;
 }