Skip to content

Commit fd0773e

Browse files
committed
[refactoring] Rename Icing to AimlessKick for more consistency
1 parent 54a2a53 commit fd0773e

13 files changed

+238
-185
lines changed

internal/app/controller/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (e *Engine) CommandForEvent(event *GameEvent) (command RefCommand, forTeam
134134
switch event.Type {
135135
case
136136
GameEventBallLeftFieldTouchLine,
137-
GameEventIcing,
137+
GameEventAimlessKick,
138138
GameEventBotKickedBallTooFast,
139139
GameEventBotDribbledBallTooFar,
140140
GameEventAttackerDoubleTouchedBall,

internal/app/controller/gameEvent.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const (
1414
GameEventNone GameEventType = ""
1515
GameEventBallLeftFieldTouchLine GameEventType = "ballLeftFieldTouchLine"
1616
GameEventBallLeftFieldGoalLine GameEventType = "ballLeftFieldGoalLine"
17-
GameEventIcing GameEventType = "icing"
17+
GameEventAimlessKick GameEventType = "aimlessKick"
1818
GameEventGoal GameEventType = "goal"
1919
GameEventIndirectGoal GameEventType = "indirectGoal"
2020
GameEventChippedGoal GameEventType = "chippedGoal"
@@ -65,7 +65,7 @@ func AllGameEvents() []GameEventType {
6565
return []GameEventType{
6666
GameEventBallLeftFieldTouchLine,
6767
GameEventBallLeftFieldGoalLine,
68-
GameEventIcing,
68+
GameEventAimlessKick,
6969
GameEventGoal,
7070
GameEventIndirectGoal,
7171
GameEventChippedGoal,
@@ -210,8 +210,8 @@ func (e GameEvent) ToProto() *refproto.GameEvent {
210210
protoEvent.Event = &refproto.GameEvent_BallLeftFieldGoalLine{BallLeftFieldGoalLine: e.Details.BallLeftFieldGoalLine}
211211
case GameEventBallLeftFieldTouchLine:
212212
protoEvent.Event = &refproto.GameEvent_BallLeftFieldTouchLine{BallLeftFieldTouchLine: e.Details.BallLeftFieldTouchLine}
213-
case GameEventIcing:
214-
protoEvent.Event = &refproto.GameEvent_Icing_{Icing: e.Details.Icing}
213+
case GameEventAimlessKick:
214+
protoEvent.Event = &refproto.GameEvent_AimlessKick_{AimlessKick: e.Details.AimlessKick}
215215
case GameEventGoal:
216216
protoEvent.Event = &refproto.GameEvent_Goal_{Goal: e.Details.Goal}
217217
case GameEventIndirectGoal:
@@ -289,7 +289,7 @@ func (e GameEvent) ToProto() *refproto.GameEvent {
289289
type GameEventDetails struct {
290290
BallLeftFieldTouchLine *refproto.GameEvent_BallLeftFieldEvent `json:"ballLeftFieldTouchLine,omitempty"`
291291
BallLeftFieldGoalLine *refproto.GameEvent_BallLeftFieldEvent `json:"ballLeftFieldGoalLine,omitempty"`
292-
Icing *refproto.GameEvent_Icing `json:"icing,omitempty"`
292+
AimlessKick *refproto.GameEvent_AimlessKick `json:"aimlessKick,omitempty"`
293293
Goal *refproto.GameEvent_Goal `json:"goal,omitempty"`
294294
IndirectGoal *refproto.GameEvent_IndirectGoal `json:"indirectGoal,omitempty"`
295295
ChippedGoal *refproto.GameEvent_ChippedGoal `json:"chippedGoal,omitempty"`
@@ -332,8 +332,8 @@ func (d GameEventDetails) EventType() GameEventType {
332332
if d.BallLeftFieldGoalLine != nil {
333333
return GameEventBallLeftFieldGoalLine
334334
}
335-
if d.Icing != nil {
336-
return GameEventIcing
335+
if d.AimlessKick != nil {
336+
return GameEventAimlessKick
337337
}
338338
if d.Goal != nil {
339339
return GameEventGoal
@@ -450,9 +450,9 @@ func (d GameEventDetails) Description() string {
450450
}
451451
return ""
452452
}
453-
if d.Icing != nil {
454-
if d.Icing.ByBot != nil {
455-
return fmt.Sprintf("By bot %v", *d.Icing.ByBot)
453+
if d.AimlessKick != nil {
454+
if d.AimlessKick.ByBot != nil {
455+
return fmt.Sprintf("By bot %v", *d.AimlessKick.ByBot)
456456
}
457457
return ""
458458
}
@@ -636,7 +636,7 @@ func (d GameEventDetails) Description() string {
636636
func NewGameEventDetails(event refproto.GameEvent) (d GameEventDetails) {
637637
d.BallLeftFieldTouchLine = event.GetBallLeftFieldTouchLine()
638638
d.BallLeftFieldGoalLine = event.GetBallLeftFieldGoalLine()
639-
d.Icing = event.GetIcing()
639+
d.AimlessKick = event.GetAimlessKick()
640640
d.Goal = event.GetGoal()
641641
d.IndirectGoal = event.GetIndirectGoal()
642642
d.ChippedGoal = event.GetChippedGoal()

internal/app/controller/placementPos.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func (e *Engine) BallPlacementPos() *Location {
4444
return e.validateLocation(location)
4545
}
4646
return nil
47-
case GameEventIcing:
48-
return e.validateProtoLocation(event.Details.Icing.KickLocation)
47+
case GameEventAimlessKick:
48+
return e.validateProtoLocation(event.Details.AimlessKick.KickLocation)
4949
case GameEventGoal:
5050
return &Location{X: 0.0, Y: 0.0}
5151
case GameEventIndirectGoal:

pkg/refproto/ssl_game_controller_auto_ref.pb.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/refproto/ssl_game_controller_common.pb.go

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/refproto/ssl_game_controller_team.pb.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/refproto/ssl_game_event.pb.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)