-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathmapGenSettings.go
More file actions
128 lines (117 loc) · 3.28 KB
/
mapGenSettings.go
File metadata and controls
128 lines (117 loc) · 3.28 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package factorio
type MapResource struct {
Frequency float32 `json:"frequency"`
Size float32 `json:"size"`
Richness float32 `json:"richness"`
}
type AutoPlaceControls struct {
Coal MapResource `json:"coal"`
Stone MapResource `json:"stone"`
CopperOre MapResource `json:"copper-ore"`
IronOre MapResource `json:"iron-ore"`
UraniumOre MapResource `json:"uranium-ore"`
CrudeOil MapResource `json:"crude-oil"`
Trees MapResource `json:"trees"`
EnemyBase MapResource `json:"enemy-base"`
}
type CliffSettings struct {
Name string `json:"name"`
CliffElevation0 int `json:"cliff_elevation_0"`
CliffElevationInterval int `json:"cliff_elevation_interval"`
Richness int `json:"richness"`
}
type PropertyExpressionNames struct {
Elevation string `json:"elevation"`
MoistureFrequencyMultiplier string `json:"control-setting:moisture:frequency:multiplier"`
MoistureBias string `json:"control-setting:moisture:bias"`
AuxFrequencyMultiplier string `json:"control-setting:aux:frequency:multiplier"`
AuxBias string `json:"control-setting:aux:bias"`
}
type StartingPoints []struct {
X int `json:"x"`
Y int `json:"y"`
}
type MapGenSettings struct {
TerrainSegmentation int `json:"terrain_segmentation"`
Water int `json:"water"`
Width int `json:"width"`
Height int `json:"height"`
StartingArea float32 `json:"starting_area"`
PeacefulMode bool `json:"peaceful_mode"`
AutoPlaceControls AutoPlaceControls `json:"autoplace_controls"`
CliffSettings CliffSettings `json:"cliff_settings"`
PropertyExpressionNames PropertyExpressionNames `json:"property_expression_names"`
StartingPoints StartingPoints `json:"starting_points"`
Seed *int `json:"seed"`
}
func DefaultMapGenSettings() MapGenSettings {
return MapGenSettings{
TerrainSegmentation: 1,
Water: 1,
Width: 0,
Height: 0,
StartingArea: 1,
PeacefulMode: false,
AutoPlaceControls: AutoPlaceControls{
Coal: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
Stone: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
CopperOre: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
IronOre: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
UraniumOre: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
CrudeOil: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
Trees: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
EnemyBase: MapResource{
Frequency: 1,
Size: 1,
Richness: 1,
},
},
CliffSettings: CliffSettings{
Name: string("cliff"),
CliffElevation0: 10,
CliffElevationInterval: 40,
Richness: 1,
},
PropertyExpressionNames: PropertyExpressionNames{
MoistureFrequencyMultiplier: "1",
MoistureBias: "0",
AuxFrequencyMultiplier: "1",
AuxBias: "0",
},
StartingPoints: StartingPoints{
{
X: 0,
Y: 0,
},
},
Seed: nil,
}
}