Beispiel #1
0
        //=========================================================================================
        /// <summary> 
        /// Constructor for the level. Initialises the basic level data structures and objects.
        /// </summary>
        //=========================================================================================
        public Level()
        {
            // Create all required objects:

            m_data      = new LevelData(this);
            m_search    = new LevelSearchQuery(this);
            m_renderer  = new LevelRenderer(this);
            m_collision = new LevelCollisionQuery(this);
            m_emitter   = new ParticleEmitter();

            // If debug then initialise debug level stuff:

            #if DEBUG

                DebugLevel.Initialize();

            #endif
        }
Beispiel #2
0
        //=========================================================================================
        /// <summary> 
        /// Clears the level. This should be used as opposed to manually clearing level data 
        /// when a level-wipe is required.
        /// </summary>
        //=========================================================================================
        public void Clear()
        {
            // Recreate all objects and override the old ones:

            m_data      = new LevelData(this);
            m_search    = new LevelSearchQuery(this);
            m_renderer  = new LevelRenderer(this);
            m_collision = new LevelCollisionQuery(this);
            m_emitter   = new ParticleEmitter();

            // Set level file name to blank:

            m_file_name = "";
        }