public TrainTroopTypeObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { TroopType troopType = StringUtils.ParseEnum <TroopType>(vo.Item); 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.Get <EventManager>().RegisterObserver(this, EventId.TroopRecruited); Service.Get <EventManager>().RegisterObserver(this, EventId.HeroMobilized); }
public static AbstractObjectiveProcessor GetProcessor(ObjectiveVO vo, ObjectiveManager parent) { switch (vo.ObjectiveType) { case ObjectiveType.Loot: return(new LootObjectiveProcessor(vo, parent)); case ObjectiveType.DestroyBuildingType: return(new DestroyBuildingTypeObjectiveProcessor(vo, parent)); case ObjectiveType.DestroyBuildingID: return(new DestroyBuildingIdObjectiveProcessor(vo, parent)); case ObjectiveType.DeployTroopType: return(new DeployTroopTypeObjectiveProcessor(vo, parent)); case ObjectiveType.DeployTroopID: return(new DeployTroopIdObjectiveProcessor(vo, parent)); case ObjectiveType.TrainTroopType: return(new TrainTroopTypeObjectiveProcessor(vo, parent)); case ObjectiveType.TrainTroopID: return(new TrainTroopIdObjectiveProcessor(vo, parent)); case ObjectiveType.ReceiveDonatedTroops: return(new ReceiveSquadUnitObjectiveProcessor(vo, parent)); case ObjectiveType.DeploySpecialAttack: return(new DeploySpecialAttackObjectiveProcessor(vo, parent)); case ObjectiveType.DeploySpecialAttackID: return(new DeploySpecialAttackIdObjectiveProcessor(vo, parent)); case ObjectiveType.TrainSpecialAttack: return(new TrainSpecialAttackObjectiveProcessor(vo, parent)); case ObjectiveType.TrainSpecialAttackID: return(new TrainSpecialAttackIdObjectiveProcessor(vo, parent)); case ObjectiveType.DonateTroopType: return(new DonateTroopTypeObjectiveProcessor(vo, parent)); case ObjectiveType.DonateTroopID: return(new DonateTroopIdObjectiveProcessor(vo, parent)); case ObjectiveType.DonateTroop: return(new DonateTroopObjectiveProcessor(vo, parent)); default: return(new AbstractObjectiveProcessor(vo, parent)); } }
public ObjectiveController() { Service.ObjectiveController = this; this.objectiveManager = Service.ObjectiveManager; Service.ViewTimeEngine.RegisterClockTimeObserver(this, 1f); this.completedObjectiveProgress = new List <ObjectiveProgress>(); this.player = Service.CurrentPlayer; EventManager eventManager = Service.EventManager; eventManager.RegisterObserver(this, EventId.UpdateObjectiveToastData); eventManager.RegisterObserver(this, EventId.ObjectivesUpdated); eventManager.RegisterObserver(this, EventId.ClaimObjectiveFailed); eventManager.RegisterObserver(this, EventId.ScreenClosing); eventManager.RegisterObserver(this, EventId.GameStateChanged); }
public LootObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { string item = vo.Item; if (!(item == "credits")) { if (!(item == "materials")) { if (item == "contraband") { this.itemType = 2; } } else { this.itemType = 1; } } else { this.itemType = 0; } Service.Get <EventManager>().RegisterObserver(this, EventId.BattleEndProcessing); }
public DeployTroopIdObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { this.troopId = vo.Item; Service.Get <EventManager>().RegisterObserver(this, EventId.TroopPlacedOnBoard); }
public DonateTroopObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { Service.Get <EventManager>().RegisterObserver(this, EventId.SquadTroopsDonatedByCurrentPlayer); }
public TrainSpecialAttackIdObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { this.specialAttackID = vo.Item; Service.Get <EventManager>().RegisterObserver(this, EventId.StarshipMobilized); }
public DonateTroopTypeObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { this.troopType = StringUtils.ParseEnum <TroopType>(vo.Item); Service.Get <EventManager>().RegisterObserver(this, EventId.SquadTroopsDonatedByCurrentPlayer); }
public DeploySpecialAttackObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { Service.Get <EventManager>().RegisterObserver(this, EventId.SpecialAttackSpawned); }
public DestroyBuildingTypeObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { this.buildingType = StringUtils.ParseEnum <BuildingType>(vo.Item); Service.Get <EventManager>().RegisterObserver(this, EventId.EntityKilled); }
public ReceiveSquadUnitObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { Service.Get <EventManager>().RegisterObserver(this, EventId.SquadTroopsReceived); }
public DeployTroopTypeObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { this.troopType = StringUtils.ParseEnum <TroopType>(vo.Item); Service.Get <EventManager>().RegisterObserver(this, EventId.TroopPlacedOnBoard); }
public TrainTroopIdObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { this.troopId = vo.Item; Service.Get <EventManager>().RegisterObserver(this, EventId.TroopRecruited); Service.Get <EventManager>().RegisterObserver(this, EventId.HeroMobilized); }
public AbstractObjectiveProcessor(ObjectiveVO objectiveVO, ObjectiveManager parent) { this.objectiveVO = objectiveVO; this.parent = parent; }
public DestroyBuildingIdObjectiveProcessor(ObjectiveVO vo, ObjectiveManager parent) : base(vo, parent) { this.buildingID = vo.Item; Service.Get <EventManager>().RegisterObserver(this, EventId.EntityKilled); }