2021-07-21 13:52:21 -05:00
|
|
|
package net.nuggetmc.ai.command.commands;
|
|
|
|
|
|
|
|
|
|
import com.jonahseguin.drink.annotation.Command;
|
|
|
|
|
import com.jonahseguin.drink.annotation.OptArg;
|
|
|
|
|
import com.jonahseguin.drink.annotation.Sender;
|
|
|
|
|
import net.nuggetmc.ai.TerminatorPlus;
|
|
|
|
|
import net.nuggetmc.ai.bot.BotManager;
|
2021-07-23 03:47:11 -05:00
|
|
|
import net.nuggetmc.ai.bot.agent.Agent;
|
|
|
|
|
import net.nuggetmc.ai.bot.agent.legacyagent.ai.NetworkType;
|
2021-07-21 13:52:21 -05:00
|
|
|
import net.nuggetmc.ai.command.CommandHandler;
|
|
|
|
|
import net.nuggetmc.ai.command.CommandInstance;
|
2021-07-21 17:18:36 -05:00
|
|
|
import org.bukkit.command.CommandSender;
|
2021-07-21 13:52:21 -05:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
|
|
public class AICommand extends CommandInstance {
|
|
|
|
|
|
|
|
|
|
private final BotManager manager;
|
2021-07-23 03:47:11 -05:00
|
|
|
private final Agent agent;
|
2021-07-21 13:52:21 -05:00
|
|
|
|
|
|
|
|
public AICommand(CommandHandler commandHandler) {
|
|
|
|
|
super(commandHandler);
|
|
|
|
|
|
|
|
|
|
this.manager = TerminatorPlus.getInstance().getManager();
|
2021-07-23 03:47:11 -05:00
|
|
|
this.agent = manager.getAgent();
|
2021-07-21 13:52:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Command(
|
|
|
|
|
desc = "The root command for bot AI training."
|
|
|
|
|
)
|
2021-07-21 17:18:36 -05:00
|
|
|
public void root(@Sender CommandSender sender) {
|
|
|
|
|
commandHandler.sendRootInfo(this, sender);
|
2021-07-21 13:52:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Command(
|
|
|
|
|
name = "random",
|
|
|
|
|
desc = "Create bots with random neural networks, collecting feed data.",
|
2021-07-23 03:47:11 -05:00
|
|
|
usage = "<amount> <name> [skin]"
|
2021-07-21 13:52:21 -05:00
|
|
|
)
|
2021-07-23 03:47:11 -05:00
|
|
|
public void random(@Sender Player sender, int n, String name, @OptArg String skin) {
|
|
|
|
|
manager.createBots(sender, name, skin, n, NetworkType.RANDOM);
|
2021-07-21 13:52:21 -05:00
|
|
|
}
|
|
|
|
|
}
|