Skip to content

Commit 8451182

Browse files
committed
Add NadeEventIf.Base() to get underlying NadeEvent
1 parent 48fed36 commit 8451182

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

events/events.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ type WeaponFiredEvent struct {
106106
// NadeEventIf is the interface for all NadeEvents. Used to catch
107107
// the different events with the same handler.
108108
type NadeEventIf interface {
109-
implementsNadeEventIf()
109+
Base() NadeEvent
110110
}
111111

112112
// NadeEvent contains the common attributes of nade events. Dont register
@@ -118,8 +118,10 @@ type NadeEvent struct {
118118
NadeEntityID int
119119
}
120120

121-
// Make NadeEvents implement NadeEventIf
122-
func (NadeEvent) implementsNadeEventIf() {}
121+
// Base returns the NadeEvent itself, used for catching all events with NadeEventIf
122+
func (ne NadeEvent) Base() NadeEvent {
123+
return ne
124+
}
123125

124126
// HeExplodedEvent signals the explosion of a HE.
125127
type HeExplodedEvent struct {

0 commit comments

Comments
 (0)