Bat/src/main/java/cc/fascinated/bat/features/Feature.java
Liam a7c3e2d745
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 36s
impl basic help command
2024-06-27 16:01:27 +01:00

39 lines
958 B
Java

package cc.fascinated.bat.features;
import cc.fascinated.bat.command.BatCommand;
import cc.fascinated.bat.command.Category;
import cc.fascinated.bat.service.CommandService;
import lombok.Getter;
import lombok.NonNull;
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;
/**
* The category of the feature
*/
private final Category category;
/**
* Registers the command for the feature
*
* @param commandService The command service
* @param command The command to register
*/
public void registerCommand(@NonNull CommandService commandService, @NonNull BatCommand command) {
command.setCategory(category);
commandService.registerCommand(command);
}
}