fCraft.CommandManager.RegisterCustomCommand C# (CSharp) Method

RegisterCustomCommand() public static method

Registers a custom command with fCraft. CommandRegistrationException may be thrown if the given descriptor does not meet all the requirements.
public static RegisterCustomCommand ( [ descriptor ) : void
descriptor [
return void
        public static void RegisterCustomCommand( [NotNull] CommandDescriptor descriptor )
        {
            if ( descriptor == null )
                throw new ArgumentNullException( "descriptor" );
            descriptor.IsCustom = true;
            RegisterCommand( descriptor );
        }

Usage Example

Example #1
0
        internal static void Init()
        {
            CommandManager.RegisterCommand(CdZoneAdd);
            CommandManager.RegisterCommand(CdZoneEdit);
            CommandManager.RegisterCommand(CdZoneInfo);
            CommandManager.RegisterCommand(CdZoneList);
            CommandManager.RegisterCommand(CdZoneMark);
            CommandManager.RegisterCommand(CdZoneRemove);
            CommandManager.RegisterCommand(CdZoneRename);
            CommandManager.RegisterCommand(CdZoneTest);

            CommandManager.RegisterCustomCommand(cdDoor);
            CommandManager.RegisterCustomCommand(cdDoorRemove);

            CommandManager.RegisterCommand(CdDoorList);
            CommandManager.RegisterCommand(CdDoorCheck);

            Player.Clicked += PlayerClickedDoor;
            openDoors       = new List <Zone>();
        }