@@ -21,19 +21,22 @@ func (gs *GameState) handleIngameTickNumber(n ingameTickNumber) {
2121}
2222
2323// IngameTick returns the latest actual tick number of the server during the game.
24+ //
2425// Watch out, I've seen this return wonky negative numbers at the start of demos.
2526func (gs GameState ) IngameTick () int {
2627 return gs .ingameTick
2728}
2829
2930// CTState returns the TeamState of the CT team.
30- // Make sure you handle swapping sides properly if you keep the reference.
31+ //
32+ // Make sure to handle swapping sides properly if you keep the reference.
3133func (gs * GameState ) CTState () * TeamState {
3234 return & gs .ctState
3335}
3436
3537// TState returns the TeamState of the T team.
36- // Make sure you handle swapping sides properly if you keep the reference.
38+ //
39+ // Make sure to handle swapping sides properly if you keep the reference.
3740func (gs * GameState ) TState () * TeamState {
3841 return & gs .tState
3942}
@@ -70,8 +73,10 @@ func (gs GameState) TeamMembers(team common.Team) []*common.Player {
7073 return r
7174}
7275
73- // GrenadeProjectiles returns a map with all grenade projectiles. The map contains only projectiles
74- // that are currently in-flight, i.e. have been thrown but have yet to detonate.
76+ // GrenadeProjectiles returns a map from entity-IDs to all live grenade projectiles.
77+ //
78+ // Only constains projectiles currently in-flight or still active (smokes etc.),
79+ // i.e. have been thrown but have yet to detonate.
7580func (gs GameState ) GrenadeProjectiles () map [int ]* common.GrenadeProjectile {
7681 return gs .grenadeProjectiles
7782}
@@ -92,6 +97,7 @@ type TeamState struct {
9297}
9398
9499// ID returns the team-ID.
100+ //
95101// This stays the same even after switching sides.
96102func (ts TeamState ) ID () int {
97103 return ts .id
@@ -108,6 +114,7 @@ func (ts TeamState) ClanName() string {
108114}
109115
110116// Flag returns the team's country flag.
117+ //
111118// Watch out, in some demos this is upper-case and in some lower-case.
112119func (ts TeamState ) Flag () string {
113120 return ts .flag
0 commit comments