Class StaticGameStatsSource
java.lang.Object
lol.trq.alts.spi.StaticGameStatsSource
- All Implemented Interfaces:
GameStatsSource
A trivial
GameStatsSource backed by a fixed, in-memory map of player UUID to display chips. It
is the simplest possible reference implementation and is handy for demos and tests where calling a
real server API is not wanted. Any UUID not in the map yields null ("no stats").- Since:
- 0.3.0
-
Constructor Summary
ConstructorsConstructorDescriptionStaticGameStatsSource(String serverId, Map<String, List<GameStats.Stat>> chipsByUuid) Creates a static source for one server. -
Method Summary
-
Constructor Details
-
StaticGameStatsSource
Creates a static source for one server.- Parameters:
serverId- the server id this source reportschipsByUuid- the chips to return per player UUID (copied defensively)- Since:
- 0.3.0
-
-
Method Details
-
serverId
Returns the identifier of the server this source covers. Used as the cache key and theGameStats.serverId()stamp, and looked up byAltsRuntime.gameStats(String).- Specified by:
serverIdin interfaceGameStatsSource- Returns:
- the server id (stable, non-null)
- Since:
- 0.3.0
-
fetch
Fetches stats for one player on this source's server.- Specified by:
fetchin interfaceGameStatsSource- Parameters:
uuid- the dashed player UUID- Returns:
- the player's stats, or
nullif unavailable - Since:
- 0.3.0
-