public void NotifyManager(Event e, object o) { // Debug.Log("Event send to the manager !"); if (e == Event.BlueprintDrawn) { // Debug.Log("Blueprint Drawn event received"); EnemyManager.S.RecalculateZone(); } else if (e == Event.RoomSetType) { SubmarineManager.S.UpdateRoom((GenericRoom)o); MiningManager.S.UpdateRoom((GenericRoom)o); } AudioManager.S.ReceiveEvent(e); if (e == Event.BlueprintFinished) { ARoom room = (ARoom)o; MapManager.S.NotifyBluePrintFininshed(room); } if (e == Event.MasterBlueprintFinished) { MasterBlueprint mbp = (MasterBlueprint)o; MapManager.S.NotifyMasterBluePrintFininshed(mbp); } foreach (var agent in _agents) { agent.OnEventReceived(e, o); } }
public override void OnEventReceived(Events.Event e, object o) { if (e == Events.Event.MasterBlueprintFinished) { MasterBlueprint mbp = (MasterBlueprint)o; if (mbp.Owner == _id) { // this is our BP GenerateNewMasterBlueprint(); } } if (e == Events.Event.ExplorationNewZone) { // check if any blueprints is active if (!MapManager.S.MapMasterBlueprints.Any(mbp => mbp.Owner == _id)) { GenerateNewMasterBlueprint(); } } }