Exemple #1
0
        internal void Setup(AIJetStreamT242Controller jetStreamController)
        {
            if (jetStreamController.IsBeingDeleted)
            {
                return;
            }
            _mono = jetStreamController;

            if (FindAllComponents() == false)
            {
                _foundComponents = false;
                QuickLogger.Error("// ============== Error getting all Components ============== //");
                TurnDisplayOff();
                return;
            }

            _mono.PowerManager.OnBreakerReset   += OnBreakerReset;
            _mono.PowerManager.OnBreakerTripped += OnBreakerTripped;


            UpdateLanguage();

            _foundComponents = true;

            QuickLogger.Debug($"Has Breaker Tripped: {_mono.PowerManager.GetHasBreakerTripped()}", true);

            StartCoroutine(_mono.PowerManager.GetHasBreakerTripped() ? PowerOff() : CompleteSetup());
        }
 public static void Postfix(AIJetStreamT242Controller __instance)
 {
     if (onJetStreamDestroyed != null)
     {
         onJetStreamDestroyed.Invoke(__instance);
     }
 }
Exemple #3
0
 private void AlertedNewTurbinePlaced(AIJetStreamT242Controller obj)
 {
     if (obj != null)
     {
         StartCoroutine(TrackNewTurbineCoroutine(obj));
     }
 }
Exemple #4
0
 private void AlertedNewTurbineDestroyed(AIJetStreamT242Controller obj)
 {
     QuickLogger.Debug("Attempting to remove turbine", true);
     if (obj != null)
     {
         QuickLogger.Debug("OBJ Not NULL", true);
         Turbines?.Remove(obj.GetPrefabId());
         QuickLogger.Debug("Past Turbine", true);
         _aiMarineMonitorDisplay?.ItemModified(TechType.None);
         QuickLogger.Debug("Removed Turbine");
     }
 }
Exemple #5
0
        private IEnumerator TrackNewTurbineCoroutine(AIJetStreamT242Controller obj)
        {
            // We yield to the end of the frame as we need the parent/children tree to update.
            yield return(new WaitForEndOfFrame());

            GameObject newSeaBase = obj?.gameObject?.transform?.parent?.gameObject;

            QuickLogger.Debug("Attempting to add turbine", true);
            if (newSeaBase != null && newSeaBase == _seaBase)
            {
                Turbines.Add(obj.GetPrefabId(), obj);
                QuickLogger.Debug($"Turbine Count: {Turbines.Count}", true);
                _aiMarineMonitorDisplay.ItemModified(TechType.None);
            }
        }
Exemple #6
0
        private void LoadDisplay(AIJetStreamT242Controller turbine)
        {
            QuickLogger.Debug("Load Monitor Display");

            GameObject itemDisplay = Instantiate(AIMarineMonitorBuildable.TurbineItemPrefab);

            QuickLogger.Debug("TurbineItemPrefab instantiated");

            itemDisplay.transform.SetParent(_itemsGrid.transform, false);
            QuickLogger.Debug("itemDisplay parent set");

            TurbineItem turbineItem = itemDisplay.EnsureComponent <TurbineItem>();

            turbineItem.Turbine = turbine;
            turbineItem.Setup(this);

            QuickLogger.Debug($"Display: {turbineItem.Display}");

            QuickLogger.Debug("Added Turbine Item Component");
        }
 internal void Initialize(AIJetStreamT242Controller mono)
 {
     _mono       = mono;
     _initialize = true;
 }
Exemple #8
0
 internal void Initialize(AIJetStreamT242Controller mono)
 {
     _capacity   = AIJetStreamT242Buildable.JetStreamT242Config.MaxCapacity;
     _mono       = mono;
     _initialize = true;
 }