public IEnumerator<object> Execute (Player p, string[] words) { foreach (PlayerCheckDelegate check in PlayerChecks) { if (check.Invoke(p) == false) return null; } return Handler.Invoke(p, words); }
static IEnumerator<object> HandleNewClients () { while (true) { IFuture f = Server.AcceptNewClient(); using (f) yield return f; TelnetClient client = f.Result as TelnetClient; Player player = new Player(client, World.PlayerStartLocation); } }
private static bool CheckPlayerIsAlive(Player p) { if (p.CurrentHealth <= 0) { p.SendMessage("You can't do that while dead."); p.SendPrompt(); return false; } return true; }