public static CTF GetInstance(World world) { if (instance == null) { world_ = world; instance = new CTF(); startTime = DateTime.Now; task_ = new SchedulerTask(Interval, true).RunForever(TimeSpan.FromMilliseconds(250)); //run loop every quarter second } return(instance); }
public static void RevertGame() //Reset game bools/stats and stop timers { task_.Stop(); world_.gameMode = GameMode.NULL; isOn = false; instance = null; started = false; if (world_.gunPhysics) { world_.DisableGunPhysics(Player.Console, true); } world_ = null; redScore = 0; blueScore = 0; redTeamCount = 0; blueTeamCount = 0; RevertNames(); }