@@ -8,9 +8,14 @@ class WolfMap {
|
||||
/// The fully parsed and decompressed levels from the game files.
|
||||
final List<WolfLevel> levels;
|
||||
final List<Matrix<int>> textures;
|
||||
final List<Matrix<int>> sprites;
|
||||
|
||||
// A private constructor so we can only instantiate this from the async loader
|
||||
WolfMap._(this.levels, this.textures);
|
||||
WolfMap._(
|
||||
this.levels,
|
||||
this.textures,
|
||||
this.sprites,
|
||||
);
|
||||
|
||||
/// Asynchronously loads the map files and parses them into a new WolfMap instance.
|
||||
static Future<WolfMap> load() async {
|
||||
@@ -22,8 +27,13 @@ class WolfMap {
|
||||
// 2. Parse the data using the parser we just built
|
||||
final parsedLevels = WolfMapParser.parseMaps(mapHead, gameMaps);
|
||||
final parsedTextures = VswapParser.parseWalls(vswap);
|
||||
final parsedSprites = VswapParser.parseSprites(vswap);
|
||||
|
||||
// 3. Return the populated instance!
|
||||
return WolfMap._(parsedLevels, parsedTextures);
|
||||
return WolfMap._(
|
||||
parsedLevels,
|
||||
parsedTextures,
|
||||
parsedSprites,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user