Skip to content

Commit 94476f5

Browse files
committed
feat(game): let a session expose the game's own configuration
1 parent d8bfbfe commit 94476f5

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/main/java/net/blueva/spoof/api/game/GameSession.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,30 @@ interface GameSession {
9696
*/
9797
fun regionKeys(): Set<String>
9898

99+
/**
100+
* A value from the game's own configuration, by dotted path.
101+
*
102+
* This is how a behaviour learns the things a game is *configured* to do rather than the things
103+
* it is currently doing: which block a floor decays into, how long a round lasts, which item
104+
* marks the objective. A server owner who retunes their minigame retunes the bots with it, for
105+
* free, because both read the same setting.
106+
*
107+
* Paths are the game's own, so a behaviour asking for one is coupled to that game, which is
108+
* fine: it is a behaviour for that game. A behaviour that asks for a path the game does not
109+
* have gets an empty optional and should have a default ready.
110+
*
111+
* @since 3.9
112+
*/
113+
fun setting(path: String): Optional<String>
114+
115+
/**
116+
* A list value from the game's own configuration. Empty when the path is missing or is not a
117+
* list.
118+
*
119+
* @since 3.9
120+
*/
121+
fun settingList(path: String): List<String>
122+
99123
/**
100124
* A provider-specific value, for behaviours written against one specific provider.
101125
*

0 commit comments

Comments
 (0)