Bat/src/main/java/cc/fascinated/bat/features/Feature.java

39 lines
958 B
Java
Raw Normal View History

2024-06-25 14:43:36 +00:00
package cc.fascinated.bat.features;
2024-06-27 15:01:27 +00:00
import cc.fascinated.bat.command.BatCommand;
import cc.fascinated.bat.command.Category;
import cc.fascinated.bat.service.CommandService;
2024-06-25 14:43:36 +00:00
import lombok.Getter;
2024-06-27 15:01:27 +00:00
import lombok.NonNull;
2024-06-25 14:43:36 +00:00
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
/**
* @author Fascinated (fascinated7)
*/
@RequiredArgsConstructor
@Getter
@Component
public abstract class Feature {
/**
* The name of the feature
*/
private final String name;
2024-06-26 11:19:11 +00:00
/**
* The category of the feature
*/
private final Category category;
/**
2024-06-27 15:01:27 +00:00
* Registers the command for the feature
*
* @param commandService The command service
* @param command The command to register
2024-06-26 11:19:11 +00:00
*/
2024-06-27 15:01:27 +00:00
public void registerCommand(@NonNull CommandService commandService, @NonNull BatCommand command) {
command.setCategory(category);
commandService.registerCommand(command);
2024-06-26 11:19:11 +00:00
}
2024-06-25 14:43:36 +00:00
}