public BattleManager(uint battleId, BattleLocation location, BattleOwner owner, IRewardStrategy rewardStrategy, IDbManager dbManager, IBattleReport battleReport, ICombatListFactory combatListFactory, IBattleFormulas battleFormulas, IBattleOrder battleOrder, IBattleRandom battleRandom) { groupIdGen = new LargeIdGenerator(uint.MaxValue); idGen = new LargeIdGenerator(uint.MaxValue); // Group id 1 is always reserved for local troop groupIdGen.Set(1); BattleId = battleId; Location = location; Owner = owner; BattleReport = battleReport; Attackers = combatListFactory.GetAttackerCombatList(); Defenders = combatListFactory.GetDefenderCombatList(); this.rewardStrategy = rewardStrategy; this.dbManager = dbManager; this.battleOrder = battleOrder; this.battleFormulas = battleFormulas; this.battleRandom = battleRandom; }
public IBattleManager CreateStrongholdMainBattleManager(uint battleId, BattleLocation battleLocation, BattleOwner battleOwner, IStronghold stronghold) { var battleRandom = new BattleRandom(battleId); var bm = new StrongholdMainBattleManager(battleId, battleLocation, battleOwner, kernel.Get <IRewardStrategyFactory>().CreateStrongholdRewardStrategy(stronghold), kernel.Get <IDbManager>(), kernel.Get <IBattleReport>(), kernel.Get <ICombatListFactory>(), kernel.Get <IGameObjectLocator>(), new BattleOrder(battleRandom), kernel.Get <IBattleFormulas>(), battleRandom); // ReSharper disable once ObjectCreationAsStatement new BattleChannel(bm, kernel.Get <IChannel>()); bm.BattleReport.Battle = bm; return(bm); }
public IBattleManager CreateStrongholdGateBattleManager(BattleLocation battleLocation, BattleOwner battleOwner, IStronghold stronghold) { var battleId = BattleReport.BattleIdGenerator.GetNext(); return(CreateStrongholdGateBattleManager(battleId, battleLocation, battleOwner, stronghold)); }
public PublicBattleManager(uint battleId, BattleLocation location, BattleOwner owner, IRewardStrategy rewardStrategy, IDbManager dbManager, IBattleReport battleReport, ICombatListFactory combatListFactory, IBattleFormulas battleFormulas, IBattleOrder battleOrder, IBattleRandom battleRandom) : base(battleId, location, owner, rewardStrategy, dbManager, battleReport, combatListFactory, battleFormulas, battleOrder, battleRandom) { }
public StrongholdMainBattleManager(uint battleId, BattleLocation location, BattleOwner owner, IRewardStrategy rewardStrategy, IDbManager dbManager, IBattleReport battleReport, ICombatListFactory combatListFactory, IGameObjectLocator gameObjectLocator, IBattleOrder battleOrder, IBattleFormulas battleFormulas, IBattleRandom random) : base(battleId, location, owner, rewardStrategy, dbManager, battleReport, combatListFactory, battleFormulas, battleOrder, random) { this.gameObjectLocator = gameObjectLocator; }
public BattleManagerGate(uint battleId, IStronghold stronghold, BattleLocation location, BattleOwner owner, IRewardStrategy rewardStrategy, IDbManager dbManager, IBattleReport battleReport, ICombatListFactory combatListFactory, IBattleFormulas battleFormulas, IBattleOrder battleOrder, IBattleRandom battleRandom) : base(battleId, location, owner, rewardStrategy, dbManager, battleReport, combatListFactory, battleFormulas, battleOrder, battleRandom) { this.stronghold = stronghold; precision = 1m + (new Random((int)(owner.Id + battleId + location.Id)).Next(-20, 20) / 100m); }
public IBattleManager CreateBarbarianBattleManager(BattleLocation battleLocation, BattleOwner battleOwner, IBarbarianTribe barbarianTribe) { var battleId = BattleReport.BattleIdGenerator.GetNext(); return(CreateBarbarianBattleManager(battleId, battleLocation, battleOwner, barbarianTribe)); }
public IBattleManager CreateBattleManager(BattleLocation location, BattleOwner owner, ICity city) { var battleId = BattleReport.BattleIdGenerator.GetNext(); return(CreateBattleManager(battleId, location, owner, city)); }