Пример #1
0
        private static void ProcessCommand(string sCmd, string sData)
        {
            int nIndex = m_Commands.IndexOfKey(sCmd);

            if (nIndex < 0)               // not found
            {
                AddLine("Unrecognized Command");
            }
            else
            {
                GameCommand Cmd = (GameCommand)m_Commands.GetByIndex(nIndex);
                Cmd.Execute(sData);
            }
        }
Пример #2
0
        private void Set(string data)
        {
            StringBuilder sTemp = new StringBuilder();

            int nSpace = data.IndexOf(" ");

            if (nSpace > 0)
            {
                string sCmd   = data.Substring(0, nSpace);
                string sData  = data.Remove(0, nSpace + 1);
                int    nIndex = m_Parameters.IndexOfKey(sCmd);

                if (nIndex < 0)                   // not found
                {
                    AddLine("Unrecognized Parameter");
                }
                else
                {
                    GameCommand Cmd = (GameCommand)m_Parameters.GetByIndex(nIndex);
                    Cmd.Execute(sData);
                }
            }
        }