@@ -23,7 +23,7 @@ const (
2323 maxWeapons = 64
2424)
2525
26- func (p * Parser ) mapEquipment () {
26+ func (p * parser ) mapEquipment () {
2727 for _ , sc := range p .stParser .ServerClasses () {
2828 switch sc .Name () {
2929 case "CC4" :
@@ -69,7 +69,7 @@ func (p *Parser) mapEquipment() {
6969}
7070
7171// Bind the attributes of the various entities to our structs on the parser
72- func (p * Parser ) bindEntities () {
72+ func (p * parser ) bindEntities () {
7373 p .bindTeamStates ()
7474 p .bindBombSites ()
7575 p .bindPlayers ()
@@ -78,7 +78,7 @@ func (p *Parser) bindEntities() {
7878 p .bindGameRules ()
7979}
8080
81- func (p * Parser ) bindBomb () {
81+ func (p * parser ) bindBomb () {
8282 bomb := & p .gameState .bomb
8383
8484 // Track bomb when it is dropped on the ground or being held by a player
@@ -115,7 +115,7 @@ func (p *Parser) bindBomb() {
115115 })
116116}
117117
118- func (p * Parser ) bindTeamStates () {
118+ func (p * parser ) bindTeamStates () {
119119 p .stParser .ServerClasses ().FindByName ("CCSTeam" ).OnEntityCreated (func (entity * st.Entity ) {
120120 team := entity .PropertyValueMust ("m_szTeamname" ).StringVal
121121
@@ -154,7 +154,7 @@ func (p *Parser) bindTeamStates() {
154154 })
155155}
156156
157- func (p * Parser ) bindBombSites () {
157+ func (p * parser ) bindBombSites () {
158158 p .stParser .ServerClasses ().FindByName ("CCSPlayerResource" ).OnEntityCreated (func (playerResource * st.Entity ) {
159159 playerResource .BindProperty ("m_bombsiteCenterA" , & p .bombsiteA .center , st .ValTypeVector )
160160 playerResource .BindProperty ("m_bombsiteCenterB" , & p .bombsiteB .center , st .ValTypeVector )
@@ -169,7 +169,7 @@ func (p *Parser) bindBombSites() {
169169 })
170170}
171171
172- func (p * Parser ) bindPlayers () {
172+ func (p * parser ) bindPlayers () {
173173 p .stParser .ServerClasses ().FindByName ("CCSPlayer" ).OnEntityCreated (func (player * st.Entity ) {
174174 p .bindNewPlayer (player )
175175 })
@@ -179,7 +179,7 @@ func (p *Parser) bindPlayers() {
179179 })
180180}
181181
182- func (p * Parser ) getOrCreatePlayer (entityID int , rp * playerInfo ) (isNew bool , player * common.Player ) {
182+ func (p * parser ) getOrCreatePlayer (entityID int , rp * playerInfo ) (isNew bool , player * common.Player ) {
183183 player = p .gameState .playersByEntityID [entityID ]
184184
185185 if player == nil {
@@ -215,7 +215,7 @@ func (p *Parser) getOrCreatePlayer(entityID int, rp *playerInfo) (isNew bool, pl
215215 return isNew , player
216216}
217217
218- func (p * Parser ) bindNewPlayer (playerEntity st.IEntity ) {
218+ func (p * parser ) bindNewPlayer (playerEntity st.IEntity ) {
219219 entityID := playerEntity .ID ()
220220 rp := p .rawPlayers [entityID - 1 ]
221221
@@ -289,7 +289,7 @@ func (p *Parser) bindNewPlayer(playerEntity st.IEntity) {
289289 }
290290}
291291
292- func (p * Parser ) bindPlayerWeapons (playerEntity st.IEntity , pl * common.Player ) {
292+ func (p * parser ) bindPlayerWeapons (playerEntity st.IEntity , pl * common.Player ) {
293293 // Some demos have an additional prefix for player weapons weapon
294294 var wepPrefix string
295295 if playerEntity .Property (playerWeaponPrefix + "000" ) != nil {
@@ -339,7 +339,7 @@ func (p *Parser) bindPlayerWeapons(playerEntity st.IEntity, pl *common.Player) {
339339 }
340340}
341341
342- func (p * Parser ) bindWeapons () {
342+ func (p * parser ) bindWeapons () {
343343 for _ , sc := range p .stParser .ServerClasses () {
344344 for _ , bc := range sc .BaseClasses () {
345345 switch bc .Name () {
@@ -358,9 +358,9 @@ func (p *Parser) bindWeapons() {
358358 p .stParser .ServerClasses ().FindByName ("CInferno" ).OnEntityCreated (p .bindNewInferno )
359359}
360360
361- // bindGrenadeProjectiles keeps track of the location of live grenades (Parser .gameState.grenadeProjectiles), actively thrown by players.
361+ // bindGrenadeProjectiles keeps track of the location of live grenades (parser .gameState.grenadeProjectiles), actively thrown by players.
362362// It does NOT track the location of grenades lying on the ground, i.e. that were dropped by dead players.
363- func (p * Parser ) bindGrenadeProjectiles (entity * st.Entity ) {
363+ func (p * parser ) bindGrenadeProjectiles (entity * st.Entity ) {
364364 entityID := entity .ID ()
365365
366366 proj := common .NewGrenadeProjectile ()
@@ -369,7 +369,7 @@ func (p *Parser) bindGrenadeProjectiles(entity *st.Entity) {
369369
370370 var wep common.EquipmentType
371371 entity .OnCreateFinished (func () {
372- // copy the weapon so it doesn't get overwritten by a new entity in Parser .weapons
372+ // copy the weapon so it doesn't get overwritten by a new entity in parser .weapons
373373 wepCopy := * (getPlayerWeapon (proj .Thrower , wep ))
374374 proj .WeaponInstance = & wepCopy
375375
@@ -421,7 +421,7 @@ func (p *Parser) bindGrenadeProjectiles(entity *st.Entity) {
421421}
422422
423423// Separate function because we also use it in round_officially_ended (issue #42)
424- func (p * Parser ) nadeProjectileDestroyed (proj * common.GrenadeProjectile ) {
424+ func (p * parser ) nadeProjectileDestroyed (proj * common.GrenadeProjectile ) {
425425 // If the grenade projectile entity is destroyed AFTER round_officially_ended
426426 // we already executed this code when we received that event.
427427 if _ , exists := p .gameState .grenadeProjectiles [proj .Entity .ID ()]; ! exists {
@@ -448,7 +448,7 @@ func (p *Parser) nadeProjectileDestroyed(proj *common.GrenadeProjectile) {
448448 }
449449}
450450
451- func (p * Parser ) bindWeapon (entity * st.Entity , wepType common.EquipmentType ) {
451+ func (p * parser ) bindWeapon (entity * st.Entity , wepType common.EquipmentType ) {
452452 entityID := entity .ID ()
453453
454454 eq , eqExists := p .gameState .weapons [entityID ]
@@ -502,7 +502,7 @@ func (p *Parser) bindWeapon(entity *st.Entity, wepType common.EquipmentType) {
502502 }
503503}
504504
505- func (p * Parser ) bindNewInferno (entity * st.Entity ) {
505+ func (p * parser ) bindNewInferno (entity * st.Entity ) {
506506 inf := common .NewInferno (p .demoInfoProvider , entity )
507507 p .gameState .infernos [entity .ID ()] = inf
508508
@@ -518,7 +518,7 @@ func (p *Parser) bindNewInferno(entity *st.Entity) {
518518}
519519
520520// Separate function because we also use it in round_officially_ended (issue #42)
521- func (p * Parser ) infernoExpired (inf * common.Inferno ) {
521+ func (p * parser ) infernoExpired (inf * common.Inferno ) {
522522 // If the inferno entity is destroyed AFTER round_officially_ended
523523 // we already executed this code when we received that event.
524524 if _ , exists := p .gameState .infernos [inf .Entity .ID ()]; ! exists {
@@ -534,7 +534,7 @@ func (p *Parser) infernoExpired(inf *common.Inferno) {
534534 p .gameEventHandler .deleteThrownGrenade (inf .Thrower (), common .EqIncendiary )
535535}
536536
537- func (p * Parser ) bindGameRules () {
537+ func (p * parser ) bindGameRules () {
538538 grPrefix := func (s string ) string {
539539 return fmt .Sprintf ("%s.%s" , gameRulesPrefix , s )
540540 }
0 commit comments