public override void OnRemove()
 {
     _appearance = null;
     _powerDevice.OnPowerStateChanged -= UpdatePower;
     _powerDevice = null;
     base.OnRemove();
 }
 public override void Initialize()
 {
     base.Initialize();
     _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>().GetBoundUserInterface(LatheUiKey.Key);
     _userInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage;
     _powerDevice = Owner.GetComponent <PowerDeviceComponent>();
 }
 public override void Initialize()
 {
     base.Initialize();
     _appearance    = Owner.GetComponent <AppearanceComponent>();
     _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>()
                      .GetBoundUserInterface(MedicalScannerUiKey.Key);
     _bodyContainer = ContainerManagerComponent.Ensure <ContainerSlot>($"{Name}-bodyContainer", Owner);
     _powerDevice   = Owner.GetComponent <PowerDeviceComponent>();
     UpdateUserInterface();
 }
 public override void Initialize()
 {
     base.Initialize();
     _appearance    = Owner.GetComponent <AppearanceComponent>();
     _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>()
                      .GetBoundUserInterface(VendingMachineUiKey.Key);
     _userInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage;
     _powerDevice = Owner.GetComponent <PowerDeviceComponent>();
     _powerDevice.OnPowerStateChanged += UpdatePower;
     InitializeFromPrototype();
 }
 public override void Initialize()
 {
     base.Initialize();
     Market         = Owner.GetComponent <GalacticMarketComponent>();
     Orders         = Owner.GetComponent <CargoOrderDatabaseComponent>();
     _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>().GetBoundUserInterface(CargoConsoleUiKey.Key);
     _userInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage;
     _powerDevice = Owner.GetComponent <PowerDeviceComponent>();
     _galacticBankManager.AddComponent(this);
     BankId = 0;
 }
        public override void Initialize()
        {
            base.Initialize();

            _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>().GetBoundUserInterface(CommunicationsConsoleUiKey.Key);
            _userInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage;
            _powerDevice = Owner.GetComponent <PowerDeviceComponent>();

            RoundEndSystem.OnRoundEndCountdownStarted   += UpdateBoundInterface;
            RoundEndSystem.OnRoundEndCountdownCancelled += UpdateBoundInterface;
            RoundEndSystem.OnRoundEndCountdownFinished  += UpdateBoundInterface;
        }
        /// <summary>
        /// Called once per instance of this component. Gets references to any other components needed
        /// by this component and initializes it's UI and other data.
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();
            _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>()
                             .GetBoundUserInterface(ReagentDispenserUiKey.Key);
            _userInterface.OnReceiveMessage += OnUiReceiveMessage;

            _beakerContainer =
                ContainerManagerComponent.Ensure <ContainerSlot>($"{Name}-reagentContainerContainer", Owner);
            _powerDevice = Owner.GetComponent <PowerDeviceComponent>();

            InitializeFromPrototype();
            UpdateUserInterface();
        }
Beispiel #8
0
        public override void Initialize()
        {
            base.Initialize();

            _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>()
                             .GetBoundUserInterface(GravityGeneratorUiKey.Key);
            _userInterface.OnReceiveMessage += HandleUIMessage;
            _powerDevice = Owner.GetComponent <PowerDeviceComponent>();
            _sprite      = Owner.GetComponent <SpriteComponent>();
            _switchedOn  = true;
            _intact      = true;
            _status      = GravityGeneratorStatus.On;
            UpdateState();
        }
Beispiel #9
0
        public override void Initialize()
        {
            base.Initialize();
            _solution ??= Owner.TryGetComponent(out SolutionComponent solutionComponent)
                ? solutionComponent
                : Owner.AddComponent <SolutionComponent>();

            _storage       = ContainerManagerComponent.Ensure <Container>("microwave_entity_container", Owner, out var existed);
            _appearance    = Owner.GetComponent <AppearanceComponent>();
            _powerDevice   = Owner.GetComponent <PowerDeviceComponent>();
            _audioSystem   = _entitySystemManager.GetEntitySystem <AudioSystem>();
            _userInterface = Owner.GetComponent <ServerUserInterfaceComponent>()
                             .GetBoundUserInterface(MicrowaveUiKey.Key);
            _userInterface.OnReceiveMessage += UserInterfaceOnReceiveMessage;
        }
 public override void Initialize()
 {
     base.Initialize();
     _powerDevice = Owner.GetComponent <PowerDeviceComponent>();
     if (_powerDevice == null)
     {
         var exc = new InvalidOperationException("Chargers requires a PowerDevice to function");
         Logger.FatalS("charger", exc.Message);
         throw exc;
     }
     _container =
         ContainerManagerComponent.Ensure <ContainerSlot>($"{Name}-powerCellContainer", Owner);
     _appearanceComponent = Owner.GetComponent <AppearanceComponent>();
     // Default state in the visualizer is OFF, so when this gets powered on during initialization it will generally show empty
     _powerDevice.OnPowerStateChanged += PowerUpdate;
 }