Пример #1
0
        public LevelLoader(Game1 game, int roomNo, bool loadSaved = false)
        {
            genericPath         = genericPathStart + game.LevelString + genericPathFinish;
            path                = Path.GetFullPath(loadSaved ? LevelSaver.SavedGamePath + genericPathFinish : @genericPath) + roomNo.ToString() + xmlExtension;
            roomStream          = File.OpenRead(path);
            roomReader          = XmlReader.Create(roomStream);
            this.roomNo         = roomNo;
            sprites             = new List <ISprite>();
            projectiles         = new List <IProjectile>();
            blocks              = new List <IBlock>();
            enemies             = new List <IEnemy>();
            npcs                = new List <INpc>();
            items               = new List <IItem>();
            effects             = new List <IEffect>();
            locations           = new Dictionary <int, Vector2>();
            this.game           = game;
            roomStreamInvisible = File.OpenRead(Path.GetFullPath(genericPath + "Invisible" + xmlExtension));
            roomReaderInvisible = XmlReader.Create(roomStreamInvisible);

            effectFactory  = new EffectSpriteFactory(this.game);
            itemFactory    = new ItemsSpriteFactory(this.game);
            dungeonFactory = new DungeonFactory(this.game, roomNo);
            bossFactory    = new BossesSpriteFactory(this.game);
            npcFactory     = new NpcsSpriteFactory(this.game);
        }
Пример #2
0
 public RoomEffect(Game1 game)
 {
     effectFactory = new EffectSpriteFactory(game);
     RoomEffects   = new List <IEffect>();
     EffectsToDie  = new List <IEffect>();
 }