コード例 #1
0
        public CubeGridManagerManager( CubeGridEntity parent, Object backingObject )
        {
            m_parent = parent;
            m_backingObject = backingObject;

            m_powerManager = new PowerManager( GetPowerManager( ) );
            m_thrusterManager = new CubeGridThrusterManager( GetThrusterManager( ), m_parent );
        }
コード例 #2
0
		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;
		}
コード例 #3
0
		public PowerReceiver(Object parent, PowerManager powerManager, Object powerReceiver)
		{
			m_parent = parent;
			m_powerManager = powerManager;
			m_powerReceiver = powerReceiver;
			m_powerRateCallback = null;

			m_maxRequiredInput = 0;
		}
コード例 #4
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;
		}
コード例 #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);
        }
コード例 #6
0
 public PowerProducer( PowerManager parent, Object powerProducer )
 {
     m_parent = parent;
     _powerProducer = powerProducer;
 }
コード例 #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";
        }