예제 #1
0
        public static Labdata Load(ILabdataReader labdataReader, IDataReader dataReader, IGameData gameData)
        {
            var labdata = new Labdata();

            labdataReader.ReadLabdata(labdata, dataReader, gameData);

            return(labdata);
        }
예제 #2
0
        public MapManager(IGameData gameData, IMapReader mapReader, ITilesetReader tilesetReader, ILabdataReader labdataReader)
        {
            foreach (var tilesetFile in gameData.Files["Icon_data.amb"].Files)
            {
                var tileset = Tileset.Load(tilesetReader, tilesetFile.Value);
                tilesets.Add((uint)tilesetFile.Key, tileset);
                tileset.Index = (uint)tilesetFile.Key;
            }

            // Map 1-256 -> File 1
            // Map 300-369 -> File 2
            // Map 257-299, 400-455, 513-528 -> File 3
            for (int i = 1; i <= 3; ++i)
            {
                var file      = gameData.Files[$"{i}Map_data.amb"];
                var textFiles = gameData.Files[$"{i}Map_texts.amb"];

                foreach (var mapFile in file.Files)
                {
                    uint index    = (uint)mapFile.Key;
                    var  textFile = textFiles.Files.ContainsKey(mapFile.Key) ? textFiles.Files[mapFile.Key] : null;
                    maps.Add(index, Map.Load(index, mapReader, mapFile.Value, textFile, tilesets));
                }
            }

            foreach (var labdataFile in gameData.Files["2Lab_data.amb"].Files) // Note: 2Lab_data.amb and 3Lab_data.amb both contain all lab data files
            {
                var labdata = Labdata.Load(labdataReader, labdataFile.Value, gameData);
                labdatas.Add((uint)labdataFile.Key, labdata);
            }
        }