Esempio n. 1
0
        public void InitializeCommands()
        {
            //build dictionary of classes and alias'

            var allCommands = (from assembly in AppDomain.CurrentDomain.GetAssemblies()
                               from type in assembly.GetTypes()
                               where type.Namespace == COMMAND_NAMESPACE
                               select type);

            foreach (Type currentCommand in allCommands)
            {
                IGameCommand commandInstance  = (IGameCommand)Activator.CreateInstance(currentCommand);
                var          commandAliasList = commandInstance.GetAlias();
                foreach (string s in commandAliasList)
                {
                    _player.CommandDictionary.Add(s, currentCommand);
                }
            }
        }