@kayahr/wastelib
    Preparing search index...

    Class GameMap

    Container for a single map from on of the GAME files.

    Index

    Methods

    • Returns the number of the disk this map belongs to.

      Returns number

      The disk number.

    • Returns the mob with the given index.

      Parameters

      • index: number

        The mob index.

      Returns Mob

      The mob.

    • Returns the number of mobs in this map.

      Returns number

      The number of mobs.

    • Returns the number of NPCs in this map.

      Returns number

      The number of NPCs.

    • Returns the number of strings in this map.

      Returns number

      The number of strings.

    • Returns the string with the given index.

      Parameters

      • index: number

        The string index.

      Returns string

      The string

    • Returns all strings defined in this map.

      Returns string[]

      All map strings.

    • Returns the map tile at the given position.

      Parameters

      • x: number

        The horizontal position on the map.

      • y: number

        The vertical position on the map.

      Returns MapTile

      The map tile.

    • Reads a game map from the given array and offset. Unfortunately maps are not completely self-contained and some information from the Exe file (map size and tile map offset address) is needed in order to read the map. You can get this data from the Exe class.

      Parameters

      • array: Uint8Array

        The array to read the map from. This is usually the content of the file GAME1 or GAME2.

      • offset: number

        The offset in the array where the map data starts.

      • mapSize: number

        The size of the map to read. This is 32 for a 32x32 map or 64 for a 64x64 map. This information can be read from the Exe#getMapSize method.

      • tileMapOffset: number

        The offset to the beginning of the tile map in the map data. This information ca be read from the Exe#getTileMapOffset method.

      Returns GameMap

      The read game map.

    • Reads a game map from the given array and offset. Unfortunately maps are not completely self-contained and some information from the Exe file (map size and tile map offset address) is needed in order to read the map. You can get this data from the Exe class.

      Parameters

      • blob: Blob

        The blob to read the map from. This is usually the the file GAME1 or GAME2.

      • offset: number

        The offset in the blob where the map data starts.

      • mapSize: number

        The size of the map to read. This is 32 for a 32x32 map or 64 for a 64x64 map. This information can be read from the Exe#getMapSize method.

      • tileMapOffset: number

        The offset to the beginning of the tile map in the map data. This information ca be read from the Exe#getTileMapOffset method.

      Returns Promise<GameMap>

      The read game map.