definiition files
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
This commit is contained in:
parent
e1daee0a1f
commit
5f5aace1e2
@ -1,7 +1,7 @@
|
||||
{
|
||||
"locations" : [
|
||||
{
|
||||
"name" : "Entrance"
|
||||
"name" : "entrance"
|
||||
}
|
||||
],
|
||||
"dependencies" : [
|
||||
|
||||
6
data/sim/location/loc.json
Normal file
6
data/sim/location/loc.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"dependencies" : [
|
||||
"./data/sim/location/building.json",
|
||||
"./data/sim/location/wilderness/wilderness.json"
|
||||
]
|
||||
}
|
||||
@ -1,8 +1,10 @@
|
||||
{
|
||||
"locations" : [
|
||||
|
||||
{
|
||||
"name" : "field"
|
||||
}
|
||||
],
|
||||
"dependencies" : [
|
||||
"./data/sim/location/building.json"
|
||||
|
||||
]
|
||||
}
|
||||
5
data/sim/location/wilderness/wilderness.json
Normal file
5
data/sim/location/wilderness/wilderness.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies" : [
|
||||
"./data/sim/location/wilderness/plains.json"
|
||||
]
|
||||
}
|
||||
13
data/sim/region/continent.json
Normal file
13
data/sim/region/continent.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name" : "continent",
|
||||
"childrenMandatory" : [
|
||||
|
||||
],
|
||||
"childrenOptional" : [
|
||||
"plains"
|
||||
],
|
||||
"dependencies" : [
|
||||
"./data/sim/region/wilderness/wilderness.json",
|
||||
"./data/sim/region/town/town.json"
|
||||
]
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name" : "world",
|
||||
"name" : "continent",
|
||||
"childrenMandatory" : [
|
||||
|
||||
],
|
||||
7
data/sim/region/wilderness/plains.json
Normal file
7
data/sim/region/wilderness/plains.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name" : "plains",
|
||||
"isWilderness" : true,
|
||||
"discoverables" : [
|
||||
"field"
|
||||
]
|
||||
}
|
||||
6
data/sim/region/wilderness/wilderness.json
Normal file
6
data/sim/region/wilderness/wilderness.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"name" : "wilderness",
|
||||
"dependencies" : [
|
||||
"./data/sim/region/wilderness/plains.json"
|
||||
]
|
||||
}
|
||||
9
data/sim/region/world.json
Normal file
9
data/sim/region/world.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"name" : "world",
|
||||
"childrenMandatory" : [
|
||||
"continent"
|
||||
],
|
||||
"dependencies" : [
|
||||
"./data/sim/region/continent.json"
|
||||
]
|
||||
}
|
||||
@ -12,6 +12,8 @@ control
|
||||
observe
|
||||
lay
|
||||
sleep
|
||||
explore (look for a new region)
|
||||
search (search for anything in the current region)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ public class LocationDefinitionManager {
|
||||
/**
|
||||
* Path to the root file
|
||||
*/
|
||||
static final String ROOT_FILE_PATH = "./data/sim/location/loc_def.json";
|
||||
static final String ROOT_FILE_PATH = "./data/sim/location/loc.json";
|
||||
|
||||
/**
|
||||
* The definitions
|
||||
@ -40,8 +40,15 @@ public class LocationDefinitionManager {
|
||||
*/
|
||||
private static void recursivelyParse(LocationDefinitionManager manager, String path){
|
||||
LocationDefinitionFile defFile = FileUtils.loadObjectFromFile(new File(path), LocationDefinitionFile.class);
|
||||
for(LocationDefinition def : defFile.getLocations()){
|
||||
manager.addDefinition(def);
|
||||
if(defFile.getLocations() != null){
|
||||
for(LocationDefinition def : defFile.getLocations()){
|
||||
manager.addDefinition(def);
|
||||
}
|
||||
}
|
||||
if(defFile.getDependencies() != null){
|
||||
for(String depPath : defFile.getDependencies()){
|
||||
recursivelyParse(manager, depPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -22,6 +22,16 @@ public class RegionDefinitionFile {
|
||||
*/
|
||||
List<String> childrenOptional;
|
||||
|
||||
/**
|
||||
* If set to true, this will be a wild region that dynamically generates locations as it is explored
|
||||
*/
|
||||
Boolean isWilderness;
|
||||
|
||||
/**
|
||||
* The location types that can be discovered in a given wilderness region
|
||||
*/
|
||||
List<String> discoverables;
|
||||
|
||||
/**
|
||||
* The region files that this file depends on
|
||||
*/
|
||||
@ -39,6 +49,14 @@ public class RegionDefinitionFile {
|
||||
return childrenOptional;
|
||||
}
|
||||
|
||||
public Boolean isWilderness(){
|
||||
return isWilderness;
|
||||
}
|
||||
|
||||
public List<String> getDiscoverables() {
|
||||
return discoverables;
|
||||
}
|
||||
|
||||
public List<String> getDependencies() {
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public class RegionDefinitionManager {
|
||||
/**
|
||||
* Path to the root file
|
||||
*/
|
||||
static final String ROOT_FILE_PATH = "./data/sim/region/region_def.json";
|
||||
static final String ROOT_FILE_PATH = "./data/sim/region/world.json";
|
||||
|
||||
/**
|
||||
* The definitions
|
||||
@ -40,7 +40,14 @@ public class RegionDefinitionManager {
|
||||
*/
|
||||
private static void recursivelyParse(RegionDefinitionManager manager, String path){
|
||||
RegionDefinitionFile def = FileUtils.loadObjectFromFile(new File(path), RegionDefinitionFile.class);
|
||||
manager.addDefinition(def);
|
||||
if(def.getName() != null){
|
||||
manager.addDefinition(def);
|
||||
}
|
||||
if(def.getDependencies() != null){
|
||||
for(String depPath : def.getDependencies()){
|
||||
recursivelyParse(manager, depPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user