DEV-1761: New rules API (#118)
* DEV-1761: Clean up Ruleset interface (#115) * remove legacy ruleset types and simplify ruleset interface * remove unnecessary settings argument from Ruleset interface * decouple rules.Settings from client API and store settings as strings * DEV 1761: Add new BoardState and Point fields (#117) * add Point.TTL, Point.Value, GameState and PointState to BoardState * allow maps to access BoardState.GameState,PointState * add PreUpdateBoard and refactor snail_mode with it * fix bug where an extra turn was printed to the console * fix formatting * fix lint errors Co-authored-by: JonathanArns <jonathan.arns@googlemail.com>
This commit is contained in:
parent
639362ef46
commit
82e1999126
50 changed files with 1349 additions and 1610 deletions
|
|
@ -9,7 +9,7 @@ func exampleSnakeRequest() SnakeRequest {
|
|||
Ruleset: Ruleset{
|
||||
Name: "test-ruleset-name",
|
||||
Version: "cli",
|
||||
Settings: exampleRulesetSettings,
|
||||
Settings: ConvertRulesetSettings(exampleRulesetSettings),
|
||||
},
|
||||
Timeout: 33,
|
||||
Source: "league",
|
||||
|
|
@ -75,21 +75,9 @@ func exampleSnakeRequest() SnakeRequest {
|
|||
}
|
||||
}
|
||||
|
||||
var exampleRulesetSettings = rules.Settings{
|
||||
FoodSpawnChance: 10,
|
||||
MinimumFood: 20,
|
||||
HazardDamagePerTurn: 30,
|
||||
HazardMap: "hz_spiral",
|
||||
HazardMapAuthor: "altersaddle",
|
||||
|
||||
RoyaleSettings: rules.RoyaleSettings{
|
||||
ShrinkEveryNTurns: 40,
|
||||
},
|
||||
|
||||
SquadSettings: rules.SquadSettings{
|
||||
AllowBodyCollisions: true,
|
||||
SharedElimination: true,
|
||||
SharedHealth: true,
|
||||
SharedLength: true,
|
||||
},
|
||||
}
|
||||
var exampleRulesetSettings = rules.NewSettings(map[string]string{
|
||||
rules.ParamFoodSpawnChance: "10",
|
||||
rules.ParamMinimumFood: "20",
|
||||
rules.ParamHazardDamagePerTurn: "30",
|
||||
rules.ParamShrinkEveryNTurns: "40",
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue