16 lines
201 B
Odin
16 lines
201 B
Odin
|
package main
|
||
|
|
||
|
|
||
|
GameState :: struct {
|
||
|
update: proc(f32),
|
||
|
draw: proc(),
|
||
|
|
||
|
variant: union{^Game, ^Menu}
|
||
|
}
|
||
|
|
||
|
new_state :: proc($T: typeid) -> ^T {
|
||
|
state := new(T)
|
||
|
state.variant = state
|
||
|
return state
|
||
|
}
|