Esempio n. 1
0
 public override void Close()
 {
     m_block.StartedProducing -= OnStateChanged;
     m_block.StoppedProducing -= OnStateChanged;
     m_block.IsWorkingChanged -= OnIsWorkingChanged;
     m_block = null;
     base.Close();
 }
        public override void Init(MyObjectBuilder_EntityBase objectBuilder)
        {
            m_generator = Entity as Sandbox.ModAPI.IMyAssembler;
            builder     = objectBuilder;

            Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_10TH_FRAME;

            terminalBlock = Entity as Sandbox.ModAPI.IMyTerminalBlock;
        }
Esempio n. 3
0
 public override void Init(MyObjectBuilder_EntityBase objectBuilder)
 {
     NeedsUpdate |= MyEntityUpdateEnum.BEFORE_NEXT_FRAME;
     m_block      = (Sandbox.ModAPI.IMyAssembler)Entity;
     m_block.StartedProducing += OnStateChanged;
     m_block.StoppedProducing += OnStateChanged;
     m_block.IsWorkingChanged += OnIsWorkingChanged;
     base.Init(objectBuilder);
 }
Esempio n. 4
0
        public override void Init(MyObjectBuilder_EntityBase objectBuilder)
        {
            m_generator = Entity as Sandbox.ModAPI.IMyAssembler;
            m_parent    = Entity as IMyCubeBlock;
            builder     = objectBuilder;

            Entity.NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_100TH_FRAME;

            terminalBlock = Entity as Sandbox.ModAPI.IMyTerminalBlock;
            if (!m_bInit)
            {
                m_bInit = true;
                LoadTerminalValues();
                CreateTerminalControls();
            }
        }
Esempio n. 5
0
 public override void Close()
 {
     m_block = null;
 }
Esempio n. 6
0
        public override void Init(MyObjectBuilder_EntityBase objectBuilder)
        {
            NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME;

            m_block = (Sandbox.ModAPI.IMyAssembler)Entity;
        }
Esempio n. 7
0
 private void Assembler_OnModeChanged(Sandbox.ModAPI.IMyAssembler assembler)
 {
     assembler.CurrentModeChanged -= Assembler_OnModeChanged;
     assembler.Mode = MyAssemblerMode.Assembly;
     assembler.CurrentModeChanged += Assembler_OnModeChanged;
 }