예제 #1
0
파일: CommandList.cs 프로젝트: crybx/mud
        public IMobileObjectCommand GetCommand(IMobileObject performer, string command)
        {
            IMobileObjectCommand iMobileObjectCommand;

            PcCommandsLookup.TryGetValue(command, out iMobileObjectCommand);

            if (iMobileObjectCommand == null)
            {
                if (performer.God)
                {
                    GodCommandsLookup.TryGetValue(command, out iMobileObjectCommand);
                }
            }

            return(iMobileObjectCommand);
        }
예제 #2
0
        public IMobileObjectCommand GetCommand(IMobileObject performer, string command)
        {
            if (!PcCommandsLookup.TryGetValue(command, out IMobileObjectCommand iMobileObjectCommand))
            {
                if (performer.God)
                {
                    GodCommandsLookup.TryGetValue(command, out iMobileObjectCommand);
                }

                if (performer is INonPlayerCharacter)
                {
                    NpcCommandsLookup.TryGetValue(command, out iMobileObjectCommand);
                }
            }

            return(iMobileObjectCommand);
        }