public CubeGridManagerManager( CubeGridEntity parent, Object backingObject )
        {
            m_parent = parent;
            m_backingObject = backingObject;

            m_powerManager = new PowerManager( GetPowerManager( ) );
            m_thrusterManager = new CubeGridThrusterManager( GetThrusterManager( ), m_parent );
        }
		public PowerReceiver(Object parent, PowerManager powerManager, Object powerReceiver, Func<float> powerRateCallback)
		{
			m_parent = parent;
			m_powerManager = powerManager;
			m_powerReceiver = powerReceiver;
			m_powerRateCallback = powerRateCallback;

			m_maxRequiredInput = 0;
		}
		public PowerReceiver(Object parent, PowerManager powerManager, Object powerReceiver)
		{
			m_parent = parent;
			m_powerManager = powerManager;
			m_powerReceiver = powerReceiver;
			m_powerRateCallback = null;

			m_maxRequiredInput = 0;
		}
		public PowerProducer(PowerManager parent, Object powerProducer)
		{
			m_parent = parent;
			m_powerProducer = powerProducer;

			m_maxPowerOutput = 0;
			m_powerOutput = 0;

			m_maxPowerOutput = MaxPowerOutput;
			m_powerOutput = PowerOutput;
		}
Ejemplo n.º 5
0
        public BatteryEntity(MyObjectBuilder_Battery battery, PowerManager powerManager, float inputRate, float outputRate, float maxCapacity)
            : base(battery)
        {
            m_parentPowerManager = powerManager;

            m_powerInputRate = inputRate;
            m_powerOutputRate = outputRate;
            m_powerMaxCapacity = maxCapacity;
            m_currentCapacity = battery.CurrentCapacity;
            m_producerEnabled = battery.ProducerEnabled;

            Action action = InternalSetupBattery;
            SandboxGameAssemblyWrapper.Instance.EnqueueMainGameAction(action);
        }
Ejemplo n.º 6
0
 public PowerProducer( PowerManager parent, Object powerProducer )
 {
     m_parent = parent;
     _powerProducer = powerProducer;
 }
Ejemplo n.º 7
0
        public CubeGridEntity(MyObjectBuilder_CubeGrid definition, Object backingObject)
            : base(definition, backingObject)
        {
            m_cubeBlockManager = new CubeBlockManager(this, backingObject, CubeGridGetCubeBlocksHashSetMethod);
            m_cubeBlockManager.Refresh();

            m_networkManager = new CubeGridNetworkManager(this);

            Object powerManager = InvokeEntityMethod(BackingObject, CubeGridGetPowerManagerMethod);
            m_powerManager = new PowerManager(powerManager);

            EntityEventManager.EntityEvent newEvent = new EntityEventManager.EntityEvent();
            newEvent.type = EntityEventManager.EntityEventType.OnCubeGridCreated;
            newEvent.timestamp = DateTime.Now;
            newEvent.entity = this;
            newEvent.priority = 1;
            EntityEventManager.Instance.AddEvent(newEvent);

            m_lastNameRefresh = DateTime.Now;
            m_name = "Cube Grid";
        }