archipelago.js@1.1.0
Archipelago.js 1.1.0 - Changelog
Made some quality of life improvements for using this library when it comes to item and location lookup. Also more functionality for PlayersManager
and ItemsManager
.
What's New?
- Updated version number to
1.1.0
. ItemsManager
now contains areceived
andindex
property.ItemsManager.received
returns an array of allNetworkItem
s that have been sent from the server.ItemsManager.index
returns the index of the next expected item to be received from the server. Any items with a lower index are stored inItemsManager.received
.- Useful for tracking if new items have been received or to check if a de-sync event occurred.
ItemsManager
will automatically attempt re-sync if it notices an item index higher than what it is expecting.PlayersManager
now contains anall
property andget
method for player lookup.PlayersManager.all
returns an array of all players. Synonymous withDataManager.players
.PlayersManager.get(id)
returns aPlayer
object orundefined
if no player was found. Synonymous withDataManager.players[id]
.
Player
objects returned fromDataManager.players
,PlayersManager.all
, orPlayersManager.get
have two helper functions for looking up item and location names.Player.item(id)
returns the name of an item that belongs to this player's game.Player.location(id)
returns the name of a location that belongs to this player's game.
What's Changed?
DataManager.players
now returns aReadonlyArray<Player>
, instead of aReadonlyMap<Player>
.- Renamed
HintManager
toHintsManager
. - Export all types again.
ItemsManager
's andLocationsManager
'sname
methods can now request either a game name or player id to lookup an item or location name.- For item/location lookup in the context of a player however, it is recommended to use the new helper functions on the
Player
object. See "What's New?" for details.
- For item/location lookup in the context of a player however, it is recommended to use the new helper functions on the
ItemsManager.name
andLocationsManager.name
returns"Unknown Item: {id}"
or"Unknown Location: {id}"
instead now.ItemsManager.name
andLocationsManager.name
will throw an error ifplayer
is not a safe integer.
What's Removed?
ItemsManager.id
andLocationsManager.id
have been removed. If needed, useDataManager.package
to lookup the inverse table.
Full Changelog: 1.0.0...1.1.0