I currently have
type Game struct {
UnitStats []UnitStats
CurrentState func(game *Game)
StateTime float64
Level Level
KeyPressed int32
CurrentMenu Menu
}```
for which i have
```golang
func (game *Game) Transition(state func(game *Game)) {
game.CurrentState = state
game.StateTime = 0
}```
it's not ideal as soon as i want another state machine outside of game... so i decided to create
```golang
type StateMachine struct {
StateTime float64
CurrentState func(*StateMachine)
}
func (stateMachine *StateMachine) Transition(state func(*StateMachine)) {
stateMachine.CurrentState = state
stateMachine.StateTime = 0
}```
this would be great, wasn't it for the fact that i now cant assign custom properties later in case i need to use it like
```golang
type Game StateMachine
and since golang doesnt have inheritance, ofc, it's not OOP, i was wondering what i could possibly do here to make it work where i can add custom properties to my state machine struct and still have the transition function, the state time variable and the current state
Thanks