Exemple #1
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);
            m_managerManager = new CubeGridManagerManager(this, GetManagerManager());

            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_lastBaseCubeBlockRefresh = DateTime.Now;
            m_name = "Cube Grid";
        }
        public CubeGridEntity( MyObjectBuilder_CubeGrid definition, Object backingObject )
            : base(definition, backingObject)
        {
            _cubeBlockManager = new CubeBlockManager( this, backingObject, CubeGridGetCubeBlocksHashSetMethod );
            _cubeBlockManager.Refresh( );

            _networkManager = new CubeGridNetworkManager( this );
            _managerManager = new CubeGridManagerManager( this, GetManagerManager( ) );

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

            _lastNameRefresh = DateTime.Now;
            _name = "Cube Grid";
        }
        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";
        }