ToString() public method

A string representation of the class. Returns a online command string, which could be written into the console.
public ToString ( ) : string
return string
Beispiel #1
0
        /// <summary>
        /// This function is used internally.
        /// It executes all needed handlers when a specific command occures.
        /// </summary>
        /// <param name="str">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="cmd">
        /// A <see cref="Command"/>
        /// </param>
        internal static void Execute(Player player, Command cmd)
        {
            foreach (KeyValuePair<string, ClientCommandDelegate> keyval in events) {
                if (cmd.ToString().StartsWith(keyval.Key)) {
                    if (keyval.Value != null) {
                        keyval.Value(player, cmd);
                    }
                }
            }

            cmd.Execute(player);
        }