Ejemplo n.º 1
0
        private void InventoryContentsChanged(MyInventoryBase inv)
        {
            if (!string.IsNullOrEmpty(m_grid.Name))
            {
                bool isPowered = MyVisualScriptLogicProvider.HasPower(m_grid.Name) && m_block.IsWorking;

                //UpdateBar(isPowered);
            }
        }
Ejemplo n.º 2
0
 public bool HasPower()
 {
     // Check if grid powered
     if (MyVisualScriptLogicProvider.HasPower(entityName) == false)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 3
0
        public bool IsPowered()
        {
            if (!ActiveEntity())
            {
                return(false);
            }

            if (string.IsNullOrWhiteSpace(MyVisualScriptLogicProvider.GetEntityName(CubeGrid.EntityId)))
            {
                MyVisualScriptLogicProvider.SetName(CubeGrid.EntityId, CubeGrid.EntityId.ToString());
            }

            return(MyVisualScriptLogicProvider.HasPower(CubeGrid.EntityId.ToString()));
        }
Ejemplo n.º 4
0
        public bool IsWorking()
        {
            if (string.IsNullOrEmpty(m_mycubegrid.Name)) // if gridname is null create one
            {
                m_mycubegrid.Name = "INCORRECT_NAME_" + m_mycubegrid.EntityId.ToString();
                MyAPIGateway.Entities.SetEntityName(m_mycubegrid, true);
            }

            if (!string.IsNullOrEmpty(m_mycubegrid.Name)) // gridname is not null
            {
                return(MyVisualScriptLogicProvider.HasPower(m_mycubegrid.Name) && m_block.IsWorking);
            }

            return(false);
        }