-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.go
52 lines (45 loc) · 2.04 KB
/
models.go
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
package main
// WarState represents the current state of the war, including which factions are involved.
type WarState struct {
WarId string `json:"warId"`
WarNumber int `json:"warNumber"`
Winner string `json:"winner"`
ConquestStartTime int64 `json:"conquestStartTime"`
ConquestEndTime int64 `json:"conquestEndTime"`
ResistanceStartTime int64 `json:"resistanceStartTime"`
RequiredVictoryTowns int `json:"requiredVictoryTowns"`
}
// Faction represents a player's faction in the game, such as Colonial or Warden.
type Faction string
const (
FactionColonial Faction = "Colonial"
FactionWarden Faction = "Warden"
FactionNone Faction = "None" // For neutral or undefined faction
)
// Player represents a human actor, associated with a faction.
type Player struct {
ID string // Unique identifier for the player
Faction Faction // The faction to which the player belongs
Username string // The player's in-game name
}
// MapItem represents non-human actors such as territories, resources, and bases.
type MapItem struct {
ID string `json:"id"` // Unique identifier for the item
Type string `json:"type"` // The type of item (e.g., resource node, base)
Location Point `json:"location"` // Geographical location on the map
Faction Faction `json:"faction"` // Controlling faction, if applicable
IsVictoryBase bool `json:"isVictoryBase"` // Indicates if this is a victory base
IsScorched bool `json:"isScorched"` // Indicates if the item is scorched
}
// Point represents a location on the map.
type Point struct {
X float64 `json:"x"`
Y float64 `json:"y"`
}
// Interaction represents an event or relationship between actors.
type Interaction struct {
Type string // The type of interaction (e.g., conflict, alliance)
Participants []string // IDs of the actors involved
Location Point // Where the interaction takes place, if applicable
Timestamp int64 // When the interaction occurred
}