private void ReadFile()
 {
     StreamReader tilesetReader = new StreamReader(path);
     TileSet tempTileSet = new TileSet(name);
     while (!tilesetReader.EndOfStream)
     {
         string line = tilesetReader.ReadLine();
         string[] contents = line.Split(":".ToCharArray());
         tempTileSet.AddTile(contents[0], content.Load<Texture2D>(contents[1]));
     }
     this.masterManager.AddTileSet(tempTileSet);
 }
Пример #2
0
        //##################################
        //######## Constructors ############
        //##################################
        public GameMap(TowerDefenseGame masterGame, string mapName)
        {
            this.masterGame = masterGame;
            this.mapName = mapName;
            tileset = masterGame.GetTileManager().getTileSet("standard");
            isPaused = false;
            selectionHasChanged = false;

            this.viewTileDistance = 5;
            Load();
            this.viewTileX = this.GetMapWidth() / 2;
            this.viewTileY = this.GetMapHeight() / 2;
        }
Пример #3
0
 public void SetTileSet(string tilesetName)
 {
     tileset = masterGame.GetTileManager().getTileSet(tilesetName);
 }
 public void AddTileSet(TileSet tileset)
 {
     tileSets.Add(tileset.GetName(), tileset);
 }