/// <summary> /// Create map /// </summary> internal Map(LevelInfoResource setLevelInfo, LevelVisualResource setLevelVisual, LevelPassableResource setLevelPassable) { OnSelectedEntitiesChanged = null; selectedEntities = new List <Entity>(); TileWidth = 16; TileHeight = 16; MapWidth = 64; MapHeight = 64; levelInfo = setLevelInfo; levelVisual = setLevelVisual; levelPassable = setLevelPassable; mapDiscoverState = new MapDiscover[MapWidth * MapHeight]; tileSet = MapTileset.GetTileset((int)levelInfo.TilesetResourceIndex); Players = new List <BasePlayer>(); AddPlayers(); Rnd = new Random(); Pathfinder = new AStar2D(); }
/// <summary> /// Load all tilesets /// </summary> internal static void LoadAllTilesets() { // TODO: FIXME with new WarFile resource loading strategy WarResource tileset = ((RawResource)WarFile.GetResourceByName("Barrens 1")).Resource; WarResource tiles = ((RawResource)WarFile.GetResourceByName("Barrens 2")).Resource; PaletteResource tilesPAL = WarFile.GetResourceByName("Barrens 3") as PaletteResource; MapTileset swamp = new MapTileset(Tileset.Swamp, tileset, tiles, tilesPAL); knownTilesets.Add(swamp); tileset = ((RawResource)WarFile.GetResourceByName("Summer 1")).Resource; tiles = ((RawResource)WarFile.GetResourceByName("Summer 2")).Resource; tilesPAL = WarFile.GetResourceByName("Summer 3") as PaletteResource; MapTileset summer = new MapTileset(Tileset.Summer, tileset, tiles, tilesPAL); knownTilesets.Add(summer); if (WarFile.IsDemo == false) { tileset = ((RawResource)WarFile.GetResourceByName("Dungeon 1")).Resource; tiles = ((RawResource)WarFile.GetResourceByName("Dungeon 2")).Resource; tilesPAL = WarFile.GetResourceByName("Dungeon 3") as PaletteResource; MapTileset dungeon = new MapTileset(Tileset.Dungeon, tileset, tiles, tilesPAL); knownTilesets.Add(dungeon); } }
/// <summary> /// Create map /// </summary> internal Map(LevelInfoResource setLevelInfo, LevelVisualResource setLevelVisual, LevelPassableResource setLevelPassable) { OnSelectedEntitiesChanged = null; selectedEntities = new List<Entity>(); TileWidth = 16; TileHeight = 16; MapWidth = 64; MapHeight = 64; levelInfo = setLevelInfo; levelVisual = setLevelVisual; levelPassable = setLevelPassable; mapDiscoverState = new MapDiscover[MapWidth * MapHeight]; tileSet = MapTileset.GetTileset((int)levelInfo.TilesetResourceIndex); Players = new List<BasePlayer> (); AddPlayers(); Rnd = new Random (); Pathfinder = new AStar2D (); }