-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmodel.go
147 lines (134 loc) · 2.28 KB
/
model.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
package main
import (
"github.com/golang/geo/r3"
"github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/common"
"github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/events"
)
// Match ...
type Match struct {
TypeName string
FileName string
Version string
UUID string
TickRate int
FrameRate int
MapName string
Started bool
Ended bool
Rounds []Round
NadeEvents []NadeEvent
KillEvents []KillEvent
}
// Round ...
type Round struct {
TypeName string
Tick int
Frame int
Round int
Started bool
TimeLimit int
FragLimit int
Objective string
BombTime float64
Winner common.Team
Reason events.RoundEndReason
Frames []Frame
BombSite string
}
// Frame ...
type Frame struct {
Tick int
Frame int
Players []Player
Nades []Nade
Bomb Bomb
}
// Player ...
type Player struct {
r3.Vector
ID uint64
Name string
Yaw float64
Hp int
Flashed float32
Money int
Team common.Team
State PlayerState
Weapon common.EquipmentType
Weapons []common.EquipmentType
}
// Nade ...
type Nade struct {
r3.Vector
ID int
Weapon common.EquipmentType
Thrower uint64
Team common.Team
Active bool
Flames [][3]r3.Vector
}
// NadeEvent ...
type NadeEvent struct {
ID int
Weapon common.EquipmentType
Thrower uint64
Team common.Team
Position r3.Vector
Velocity r3.Vector
Yaw float32
Pitch float32
Tick int
Frame int
Round int
}
// KillEvent ...
type KillEvent struct {
r3.Vector
Killer uint64
Victim uint64
Assister uint64
Weapon common.EquipmentType
Team common.Team
Penetrated int
IsHeadshot bool
AssistedFlash bool
AttackerBlind bool
NoScope bool
ThroughSmoke bool
Distance float32
From r3.Vector
Tick int
Frame int
Round int
}
// Bomb ...
type Bomb struct {
r3.Vector
State BombState
}
// BombState ...
type BombState = int
// BombState ...
const (
BombPlanting BombState = (1 << iota)
BombPlanted
BombDefusing
BombDefused
BombExploded
)
// PlayerState ...
type PlayerState = int
// PlayerState ...
const (
HasHelmet = (1 << iota)
HasArmor
HasDefuseKit
HasBomb
IsBot
IsConnected
IsDucking
IsDefusing
IsPlanting
IsReloading
IsUnknown
)