Use the EventMap::SetPhase and EventMap::IsInPhase functions for this, also, use an enum for these phases.