aboutsummaryrefslogtreecommitdiff
path: root/docs/simulation/provinces.md
blob: 014735c54f8e57ce153af1fd60edbdc30075db8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# OpenVic2 Provinces

## OpenVic2 Structure

```mermaid
classDiagram
   class Province {
      Int64 id                 
      string provinceName    
      string tradeGood       
      Int64 lifeRating         
      bool hasLegalSlavery   
      Int64 fortLevel          
      Int64 navalBaseLevel     
      Int64 railroadLevel
      
   }
```
<!-- The following attributes will need to be added when Nations are added
   NationId owningNation
   NationId controllingNation
   NationId[] coreNations
-->

## Dataloading
The `provinces.json` file shall look like:
```json
{
   "provinces": [
      ...
   ],

   "regions": [
      {"id": "", "name": "", "provinceIds": [...]},
      ...
   ],

   "continents": [
      {"id": "", "name": "", "provinceIds": [...]},
      ...
   ]
}
```
Where the `"provinces"` array contains valid province JSON objects which conform to the following key-value pairs:
| Key | type | Required? | Default Value |
|--|--|--|--|
| id              | int    | required | N/A       |
| provinceName    | string | required | N/A       |
| tradeGood       | string | optional | "no_good" |
| lifeRating      | int    | optional | 0         |
| hasLegalSlavery | bool   | optional | false     |
| fortLevel       | int    | optional | 0         |
| navalBaseLevel  | int    | optional | 0         |
| railroadLevel   | int    | optional | 0         |

### Notes on values
- The values of `fortLevel`, `navalBaseLevel`, and `railroadLevel` may not be negative
- The value of `tradeGood` may only be a Good Identifier string as defined in [goods.md](goods.md) or `"no_good"`