/// <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()); }
public Scores(ServerData serverState) { this.serverState = serverState; }
/// <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; }
public CheckForMinefields(ServerData serverState) { this.serverState = serverState; }
public Manufacture(ServerData serverState) { this.serverState = serverState; }
public Bombing(ServerData serverState) { this.serverState = serverState; }
public SimpleTurnGenerator(ServerData serverState) : base(serverState) { }
public VictoryCheck(ServerData serverState, Scores scores) { this.serverState = serverState; this.Scores = scores; }
public IntelWriter(ServerData serverState, Scores scores) { this.serverState = serverState; this.scores = scores; }