@@ -23,6 +23,8 @@ const (
2323 UiProtocolGameEventIgnored UiProtocolType = "ignoredGameEvent"
2424 // UiProtocolModify represents a manual modification on the state
2525 UiProtocolModify UiProtocolType = "modify"
26+ // UiProtocolTeamAction represents an action from a team
27+ UiProtocolTeamAction UiProtocolType = "teamAction"
2628)
2729
2830// UiProtocolEntry represents a single protocol entry as should be displayed in the UI table
@@ -125,3 +127,31 @@ func (e *Engine) LogModify(m EventModifyValue) {
125127 }
126128 e .UiProtocol = append (e .UiProtocol , entry )
127129}
130+
131+ // LogTeamGoalkeeperChange adds a goalkeeper change from a team to the protocol
132+ func (e * Engine ) LogTeamGoalkeeperChange (forTeam Team , oldGoalkeeperId int , newGoalkeeperId int ) {
133+ description := fmt .Sprintf ("%v -> %v" , oldGoalkeeperId , newGoalkeeperId )
134+ entry := UiProtocolEntry {
135+ Timestamp : e .TimeProvider ().UnixNano (),
136+ StageTime : e .State .StageTimeElapsed ,
137+ Type : UiProtocolTeamAction ,
138+ Name : "Goalkeeper" ,
139+ Team : forTeam ,
140+ Description : description ,
141+ }
142+ e .UiProtocol = append (e .UiProtocol , entry )
143+ }
144+
145+ // LogTeamBotSubstitutionChange adds a bot substitution intend change from a team to the protocol
146+ func (e * Engine ) LogTeamBotSubstitutionChange (forTeam Team , substituteBot bool ) {
147+ description := fmt .Sprintf ("%v" , substituteBot )
148+ entry := UiProtocolEntry {
149+ Timestamp : e .TimeProvider ().UnixNano (),
150+ StageTime : e .State .StageTimeElapsed ,
151+ Type : UiProtocolTeamAction ,
152+ Name : "BotSubstitutionIntend" ,
153+ Team : forTeam ,
154+ Description : description ,
155+ }
156+ e .UiProtocol = append (e .UiProtocol , entry )
157+ }
0 commit comments