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 }