Skip to content

Commit 45a316c

Browse files
committed
v3: remove depreacted parts of API (#337)
1 parent b1ed839 commit 45a316c

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

pkg/demoinfocs/common/player.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,6 @@ func (p *Player) entityIDStr() string {
375375
return fmt.Sprintf("%03d", p.EntityID)
376376
}
377377

378-
// ResourceEntity returns the game's CCSPlayerResource entity.
379-
// Deprecated: use GameState.PlayerResourceEntity() instead.
380-
func (p *Player) ResourceEntity() st.Entity {
381-
return p.resourceEntity()
382-
}
383-
384378
func (p *Player) resourceEntity() st.Entity {
385379
return p.demoInfoProvider.PlayerResourceEntity()
386380
}

pkg/demoinfocs/game_rules_interface.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ package demoinfocs
44

55
import (
66
"time"
7+
8+
st "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/sendtables"
79
)
810

911
// GameRules is an auto-generated interface for gameRules.
@@ -21,4 +23,6 @@ type GameRules interface {
2123
// Not all values might be set.
2224
// See also: https://developer.valvesoftware.com/wiki/List_of_CS:GO_Cvars.
2325
ConVars() map[string]string
26+
// Entity returns the game's CCSGameRulesProxy entity.
27+
Entity() st.Entity
2428
}

pkg/demoinfocs/game_state.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,6 @@ func (gs gameState) IsMatchStarted() bool {
168168
return gs.isMatchStarted
169169
}
170170

171-
// ConVars returns a map of CVar keys and values.
172-
// Not all values might be set.
173-
// See also: https://developer.valvesoftware.com/wiki/List_of_CS:GO_Cvars.
174-
// Deprecated: see GameRules().ConVars()
175-
func (gs *gameState) ConVars() map[string]string {
176-
return gs.rules.ConVars()
177-
}
178-
179171
// PlayerResourceEntity returns the game's CCSPlayerResource entity.
180172
// Contains scoreboard information and more.
181173
func (gs *gameState) PlayerResourceEntity() st.Entity {
@@ -261,6 +253,11 @@ func (gr gameRules) ConVars() map[string]string {
261253
return gr.conVars
262254
}
263255

256+
// Entity returns the game's CCSGameRulesProxy entity.
257+
func (gr gameRules) Entity() st.Entity {
258+
return gr.entity
259+
}
260+
264261
// participants provides helper functions on top of the currently connected players.
265262
// E.g. ByUserID(), ByEntityID(), TeamMembers(), etc.
266263
//

pkg/demoinfocs/game_state_interface.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ type GameState interface {
5757
IsWarmupPeriod() bool
5858
// IsMatchStarted returns whether the match has started according to CCSGameRulesProxy.
5959
IsMatchStarted() bool
60-
// ConVars returns a map of CVar keys and values.
61-
// Not all values might be set.
62-
// See also: https://developer.valvesoftware.com/wiki/List_of_CS:GO_Cvars.
63-
// Deprecated: see GameRules().ConVars()
64-
ConVars() map[string]string
6560
// PlayerResourceEntity returns the game's CCSPlayerResource entity.
6661
// Contains scoreboard information and more.
6762
PlayerResourceEntity() st.Entity

0 commit comments

Comments
 (0)