Ejemplo 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;
        }
Ejemplo 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);
 }
Ejemplo 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();
            }
        }
Ejemplo n.º 5
0
 public override void Close()
 {
     m_block = null;
 }
Ejemplo n.º 6
0
        public override void Init(MyObjectBuilder_EntityBase objectBuilder)
        {
            NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME;

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