Skip to content

Commit

Permalink
impr: documentation and annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
MatzHilven committed Jun 19, 2024
1 parent 4559755 commit 745988f
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/main/java/com/slampvp/factory/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,48 @@

import com.slampvp.factory.player.Rank;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* The Command annotation is used to provide metadata for command methods.
* It includes a description of the command, its usage, the minimum rank required
* to execute the command, and whether the command can only be executed by players.
*
* @see com.slampvp.factory.player.Rank
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Command {

/**
* A brief description of what the command does.
*
* @return the description of the command
*/
String description();

/**
* A string explaining how to use the command.
*
* @return the usage syntax of the command
*/
String usage();

/**
* The minimum rank required to execute the command.
*
* @return the minimum rank required to execute the command
*/
Rank minimumRank();

/**
* A flag indicating whether the command can only be executed by players
* (as opposed to console or other entities).
*
* @return true if the command can only be executed by players, false otherwise
*/
boolean playerOnly();
}
}

0 comments on commit 745988f

Please sign in to comment.