package cz.davza.studentadventure.commands; import cz.davza.studentadventure.annotations.CommandKeyword; import cz.davza.studentadventure.base.CommandBase; import cz.davza.studentadventure.objects.CommandResult; import cz.davza.studentadventure.objects.GameData; /** * Displays the full command reference for the game. * *

Usage: {@code help}

* *

Prints a static list of every command keyword and a short description of * what it does. Available in all rooms. No parameters are required.

*/ @CommandKeyword("help") public class HelpCommand extends CommandBase { /** * {@inheritDoc} * Returns the full command reference as a formatted string. */ @Override public CommandResult Execute(GameData context) { return CommandResult.success(printHelp()); } /** * Builds and returns the command reference text. * * @return a multi-line string listing all available commands and their usage */ private String printHelp() { return """ === COMMANDS === walk - Move to another room pickup - Pick up n of an item drop - Drop item from inventory slot interact - Interact with an item study - Study for n hours sleep - Sleep (bedroom and classroom only) steal - Steal money (study room only) buy - Buy an item (shop only) consume - Consume an item from inventory takeexam - Take the final exam (exam room only) inventory - Show your inventory stats - Show your stats time - Show current game time describe - Describe the current scene quit - Give up studentId - Tells you your student ID (computer only) availablecommands - Tells you your currently available commands """; } }