示例#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;
 }