public LootGoalProcessor(IValueObject vo, AbstractGoalManager parent) : base(vo, parent) { string goalItem = parent.GetGoalItem(vo); if (goalItem != null) { if (goalItem == "credits") { this.itemType = 0; goto IL_92; } if (goalItem == "materials") { this.itemType = 1; goto IL_92; } if (goalItem == "contraband") { this.itemType = 2; goto IL_92; } } Service.Logger.ErrorFormat("Loot type not found for goal {0}", new object[] { vo.Uid }); IL_92: Service.EventManager.RegisterObserver(this, EventId.BattleEndProcessing); }
public DestroyBuildingIdGoalProcessor(IValueObject vo, AbstractGoalManager parent) : base(vo, parent) { this.buildingID = parent.GetGoalItem(vo); if (string.IsNullOrEmpty(this.buildingID)) { Service.Logger.ErrorFormat("Building ID not found for goal {0}", new object[] { vo.Uid }); } Service.EventManager.RegisterObserver(this, EventId.EntityKilled); }
public DeployTroopIdGoalProcessor(IValueObject vo, AbstractGoalManager parent) : base(vo, parent) { this.troopId = parent.GetGoalItem(vo); if (string.IsNullOrEmpty(this.troopId)) { Service.Logger.ErrorFormat("Troop ID not found for goal {0}", new object[] { vo.Uid }); } Service.EventManager.RegisterObserver(this, EventId.TroopPlacedOnBoard); }
public DeploySpecialAttackIdGoalProcessor(IValueObject vo, AbstractGoalManager parent) : base(vo, parent) { this.specialAttackID = parent.GetGoalItem(vo); if (string.IsNullOrEmpty(this.specialAttackID)) { Service.Logger.ErrorFormat("Special Attack ID not found for goal {0}", new object[] { vo.Uid }); } Service.EventManager.RegisterObserver(this, EventId.SpecialAttackSpawned); }
public DestroyBuildingTypeGoalProcessor(IValueObject vo, AbstractGoalManager parent) : base(vo, parent) { string goalItem = parent.GetGoalItem(vo); if (string.IsNullOrEmpty(goalItem)) { Service.Logger.ErrorFormat("Building Type not found for goal {0}", new object[] { vo.Uid }); } else { this.buildingType = StringUtils.ParseEnum <BuildingType>(goalItem); } Service.EventManager.RegisterObserver(this, EventId.EntityKilled); }
public DeployTroopTypeGoalProcessor(IValueObject vo, AbstractGoalManager parent) : base(vo, parent) { string goalItem = parent.GetGoalItem(vo); if (string.IsNullOrEmpty(goalItem)) { Service.Logger.ErrorFormat("Troop type not found for goal {0}", new object[] { vo.Uid }); } else { this.troopType = StringUtils.ParseEnum <TroopType>(goalItem); } Service.EventManager.RegisterObserver(this, EventId.TroopPlacedOnBoard); }
public TrainTroopTypeGoalProcessor(IValueObject vo, AbstractGoalManager parent) : base(vo, parent) { TroopType troopType = TroopType.Invalid; string goalItem = parent.GetGoalItem(vo); if (string.IsNullOrEmpty(goalItem)) { Service.Logger.ErrorFormat("Troop Type not found for goal {0}", new object[] { vo.Uid }); } else { troopType = StringUtils.ParseEnum <TroopType>(goalItem); } if (troopType == TroopType.Champion) { this.deliveryType = DeliveryType.Champion; } else if (troopType == TroopType.Hero) { this.deliveryType = DeliveryType.Hero; } else if (troopType == TroopType.Infantry) { this.deliveryType = DeliveryType.Infantry; } else if (troopType == TroopType.Mercenary) { this.deliveryType = DeliveryType.Mercenary; } else if (troopType == TroopType.Vehicle) { this.deliveryType = DeliveryType.Vehicle; } Service.EventManager.RegisterObserver(this, EventId.TroopRecruited); Service.EventManager.RegisterObserver(this, EventId.HeroMobilized); }