mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
PathfinderOptions: use settings and move all defaults into schema
This commit is contained in:
parent
cb61572878
commit
e91d79414b
@ -3,7 +3,7 @@
|
|||||||
{
|
{
|
||||||
"type" : "object",
|
"type" : "object",
|
||||||
"$schema": "http://json-schema.org/draft-04/schema",
|
"$schema": "http://json-schema.org/draft-04/schema",
|
||||||
"required" : [ "general", "video", "adventure", "battle", "server", "logging", "launcher" ],
|
"required" : [ "general", "video", "adventure", "pathfinder", "battle", "server", "logging", "launcher" ],
|
||||||
"definitions" : {
|
"definitions" : {
|
||||||
"logLevelEnum" : {
|
"logLevelEnum" : {
|
||||||
"type" : "string",
|
"type" : "string",
|
||||||
@ -108,6 +108,74 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pathfinder" : {
|
||||||
|
"type" : "object",
|
||||||
|
"additionalProperties" : false,
|
||||||
|
"default": {},
|
||||||
|
"required" : [ "teleports", "layers", "oneTurnSpecialLayersLimit", "originalMovementRules", "lightweightFlyingMode" ],
|
||||||
|
"properties" : {
|
||||||
|
"layers" : {
|
||||||
|
"type" : "object",
|
||||||
|
"additionalProperties" : false,
|
||||||
|
"default": {},
|
||||||
|
"required" : [ "sailing", "waterWalking", "flying" ],
|
||||||
|
"properties" : {
|
||||||
|
"sailing" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : true
|
||||||
|
},
|
||||||
|
"waterWalking" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : true
|
||||||
|
},
|
||||||
|
"flying" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"teleports" : {
|
||||||
|
"type" : "object",
|
||||||
|
"additionalProperties" : false,
|
||||||
|
"default": {},
|
||||||
|
"required" : [ "twoWay", "oneWay", "oneWayRandom", "whirlpool", "castleGate" ],
|
||||||
|
"properties" : {
|
||||||
|
"twoWay" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : true
|
||||||
|
},
|
||||||
|
"oneWay" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : true
|
||||||
|
},
|
||||||
|
"oneWayRandom" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : false
|
||||||
|
},
|
||||||
|
"whirlpool" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : true
|
||||||
|
},
|
||||||
|
"castleGate" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oneTurnSpecialLayersLimit" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : true
|
||||||
|
},
|
||||||
|
"originalMovementRules" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : false
|
||||||
|
},
|
||||||
|
"lightweightFlyingMode" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"default" : false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"battle" : {
|
"battle" : {
|
||||||
"type" : "object",
|
"type" : "object",
|
||||||
"additionalProperties" : false,
|
"additionalProperties" : false,
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "mapObjects/CGHeroInstance.h"
|
#include "mapObjects/CGHeroInstance.h"
|
||||||
#include "GameConstants.h"
|
#include "GameConstants.h"
|
||||||
#include "CStopWatch.h"
|
#include "CStopWatch.h"
|
||||||
|
#include "CConfigHandler.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CPathfinder.cpp, part of VCMI engine
|
* CPathfinder.cpp, part of VCMI engine
|
||||||
@ -20,19 +21,19 @@
|
|||||||
|
|
||||||
CPathfinder::PathfinderOptions::PathfinderOptions()
|
CPathfinder::PathfinderOptions::PathfinderOptions()
|
||||||
{
|
{
|
||||||
useFlying = true;
|
useFlying = settings["pathfinder"]["layers"]["flying"].Bool();
|
||||||
useWaterWalking = true;
|
useWaterWalking = settings["pathfinder"]["layers"]["waterWalking"].Bool();
|
||||||
useEmbarkAndDisembark = true;
|
useEmbarkAndDisembark = settings["pathfinder"]["layers"]["sailing"].Bool();
|
||||||
useTeleportTwoWay = true;
|
useTeleportTwoWay = settings["pathfinder"]["teleports"]["twoWay"].Bool();
|
||||||
useTeleportOneWay = true;
|
useTeleportOneWay = settings["pathfinder"]["teleports"]["oneWay"].Bool();
|
||||||
useTeleportOneWayRandom = false;
|
useTeleportOneWayRandom = settings["pathfinder"]["teleports"]["oneWayRandom"].Bool();
|
||||||
useTeleportWhirlpool = true;
|
useTeleportWhirlpool = settings["pathfinder"]["teleports"]["whirlpool"].Bool();
|
||||||
|
|
||||||
useCastleGate = false;
|
useCastleGate = settings["pathfinder"]["teleports"]["castleGate"].Bool();
|
||||||
|
|
||||||
lightweightFlyingMode = false;
|
lightweightFlyingMode = settings["pathfinder"]["lightweightFlyingMode"].Bool();
|
||||||
oneTurnSpecialLayersLimit = true;
|
oneTurnSpecialLayersLimit = settings["pathfinder"]["oneTurnSpecialLayersLimit"].Bool();
|
||||||
originalMovementRules = true;
|
originalMovementRules = settings["pathfinder"]["originalMovementRules"].Bool();
|
||||||
}
|
}
|
||||||
|
|
||||||
CPathfinder::CPathfinder(CPathsInfo & _out, CGameState * _gs, const CGHeroInstance * _hero)
|
CPathfinder::CPathfinder(CPathsInfo & _out, CGameState * _gs, const CGHeroInstance * _hero)
|
||||||
|
Loading…
Reference in New Issue
Block a user