private void CheckEventQueue() { // A while loop is required in case there are multiple events triggered // at the same time. while (this.eventQueue.Count > 0) { GameEvent existingEvent = this.eventQueue[0]; if (existingEvent.ExecutionTime < this.time) { existingEvent.Action(); this.eventQueue.Remove(existingEvent); continue; } break; } }