@ -1,7 +1,6 @@
package net.pingex.dcf.commands ;
import net.pingex.dcf.commands.options.ICommandOption ;
import net.pingex.dcf.commands.options.ScopeOption ;
import net.pingex.dcf.permissions.DefaultPermission ;
import sx.blah.discord.handle.impl.events.MessageReceivedEvent ;
import java.lang.reflect.Method ;
@ -45,11 +44,6 @@ public abstract class Command implements ICommandExecutor
* /
private DefaultPermission defaultPermission ;
/ * *
* Tells where the command should run , ie . PM or guild chat , or both
* /
private ScopeOption . CommandScope commandScope ;
/ * *
* Contains all options for this command .
* /
@ -63,10 +57,9 @@ public abstract class Command implements ICommandExecutor
* @param isEnabled Is the command enabled ?
* @param usage Command usage help
* @param defaultPermission Default permission , ie . when the permissions provider doesn ' t return anything .
* @param commandScope Tells where the command should run , ie . PM or guild chat , or both
* @param options Command options .
* /
public Command ( String name , List < String > aliases , String description , boolean isEnabled , String usage , DefaultPermission defaultPermission , S copeOption. CommandScope commandScope , S et< ICommandOption > options )
public Command ( String name , List < String > aliases , String description , boolean isEnabled , String usage , DefaultPermission defaultPermission , S et< ICommandOption > options )
{
this . name = name ;
this . aliases = aliases ;
@ -74,7 +67,6 @@ public abstract class Command implements ICommandExecutor
this . isEnabled = isEnabled ;
this . usage = usage ;
this . defaultPermission = defaultPermission ;
this . commandScope = commandScope ;
this . commandOptions = options ;
}
@ -88,7 +80,6 @@ public abstract class Command implements ICommandExecutor
public static final boolean IS_ENABLED = true ;
public static final String USAGE = "No command usage provided." ;
public static final DefaultPermission DEFAULT_PERMISSION = DefaultPermission . EVERYONE ;
public static final ScopeOption . CommandScope COMMAND_SCOPE = ScopeOption . CommandScope . NOWHERE ; // NOWHERE is enforced as a default value to force devs to specify a real scope.
public static final Set < ICommandOption > OPTIONS = Collections . emptySet ( ) ;
}
@ -127,11 +118,6 @@ public abstract class Command implements ICommandExecutor
* /
private DefaultPermission defaultPermission = Defaults . DEFAULT_PERMISSION ;
/ * *
* Tells where the command should run , ie . PM or guild chat , or both
* /
private ScopeOption . CommandScope commandScope = Defaults . COMMAND_SCOPE ;
/ * *
* Command options
* /
@ -182,12 +168,6 @@ public abstract class Command implements ICommandExecutor
return this ;
}
public Builder commandScope ( ScopeOption . CommandScope commandScope )
{
this . commandScope = commandScope ;
return this ;
}
public Builder options ( Set < ICommandOption > options )
{
commandOptions = options ;
@ -201,7 +181,7 @@ public abstract class Command implements ICommandExecutor
* /
public Command build ( ICommandExecutor toExecute )
{
return new Command ( name , aliases , description , isEnabled , usage , defaultPermission , command Scope, command Options)
return new Command ( name , aliases , description , isEnabled , usage , defaultPermission , command Options)
{
@Override
public void execute ( MessageReceivedEvent event , List < String > arguments ) throws Throwable
@ -219,7 +199,7 @@ public abstract class Command implements ICommandExecutor
* /
public Command build ( Method target , Object invokable )
{
return new Command ( name , aliases , description , isEnabled , usage , defaultPermission , command Scope, command Options)
return new Command ( name , aliases , description , isEnabled , usage , defaultPermission , command Options)
{
@Override
public void execute ( MessageReceivedEvent event , List < String > arguments ) throws Throwable
@ -253,7 +233,6 @@ public abstract class Command implements ICommandExecutor
. enabled ( meta . isEnabled ( ) )
. usage ( meta . usage ( ) )
. defaultPermission ( meta . defaultPermission ( ) )
. commandScope ( meta . scope ( ) )
. build ( target , invokable ) ;
}
@ -287,11 +266,6 @@ public abstract class Command implements ICommandExecutor
return defaultPermission ;
}
public ScopeOption . CommandScope getScope ( )
{
return commandScope ;
}
public Set < ICommandOption > getOptions ( )
{
return Collections . unmodifiableSet ( commandOptions ) ;