private static bool ExecuteCombatForVolley(int currentVolley, int currentExchange, GameState gameState, IList <IEventActor> actors, IServiceProvider services) { var logger = services.GetLogger(); logger.LogInformation(" - FIRE SEGMENT"); // TODO: DI this interaction -- pass in EventHandlingEngine as a parameter // TODO: EventHandlingEngine should populate its own IList<GameActor> property var eventEngine = new EventHandlingEngine(); var distanceGraph = gameState.DistanceGraph; eventEngine.ExecuteGamePhase(actors, new FiringPhaseEvent(currentVolley, currentExchange, distanceGraph), 1, 1); //--And return! return(true); }
public void InitServices() { this.services = new ServiceCollection() .AddLogging() .AddSingleton <IDiceUtility, MockDice>() // Always rolls sixes on d6; always rolls 99 on d100 .BuildServiceProvider(); this.weapon = new BeamBatterySystem(3, "(All arcs)"); this.weaponAllocation = new GameUnitFireAllocation(); this.distanceGraph = new FormationDistanceGraph(); this.totalDummy = new TestDummyActor(this.services); this.phaseDummy = new TestDummyPhaseActor(this.services); this.engine = new EventHandlingEngine(); this.phaseEvent = new FiringPhaseEvent(1, 1, this.distanceGraph) as GamePhaseEvent; this.attackEvent = new WeaponAttackEvent(new TargetingData(), new AttackData(this.weapon, this.weaponAllocation)); }