ImportLevel() public méthode

Goes through the xml file and translates the information
public ImportLevel ( Level level ) : Level
level Level
Résultat Level
Exemple #1
0
        /// <summary>
        /// Loads the level from the content manager
        /// </summary>
        /// <param name="content">Content Manager to load from</param>
        public void Load(ContentManager content)
        {
            _mObjects.Clear();
            Reset();

            var importer = new Importer(content);
            importer.ImportLevel(this);

            _mPlayer = new Player(content, ref _mPhysicsEnvironment,
                _mControls, .8f, EntityInfo.CreatePlayerInfo(GridSpace.GetGridCoord(StartingPoint)));

            _mObjects.Add(_mPlayer);
            _mObjects.AddRange(importer.GetObjects(ref _mPhysicsEnvironment));

            _mPlayerEnd = importer.GetPlayerEnd();
            if (_mPlayerEnd != null)
                _mObjects.Add(_mPlayerEnd);

            _mObjects.AddRange(importer.GetWalls(this).Cast<GameObject>());

            _mRails = importer.GetRails();

            _mTrigger.AddRange(importer.GetTriggers());

            PrepareCollisionMatrix();

            MNumCollected = 0;
            MNumCollectable = 0;

            //Clear the collection lists
            _mCollected.Clear();
            _mRemoveCollected.Clear();

            foreach (var gObject in _mObjects)
            {
                if (gObject.CollisionType == XmlKeys.Collectable)
                    MNumCollectable++;
            }
        }