diff options
author | Your Name <you@example.com> | 2022-01-16 21:32:01 -0500 |
---|---|---|
committer | Your Name <you@example.com> | 2022-01-16 21:32:01 -0500 |
commit | d0e356d09e30a11c1e072415a5088f829d5c0a04 (patch) | |
tree | 1e64d37b9b424cd74c30ad4c8225828c7a76874e /src/cmd/cmd.h | |
parent | 3f78a7e1647ba94129236bd2bf4fc855c109628a (diff) | |
download | dmtool-d0e356d09e30a11c1e072415a5088f829d5c0a04.tar.gz dmtool-d0e356d09e30a11c1e072415a5088f829d5c0a04.tar.bz2 dmtool-d0e356d09e30a11c1e072415a5088f829d5c0a04.zip |
Worked on features
Diffstat (limited to 'src/cmd/cmd.h')
-rw-r--r-- | src/cmd/cmd.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/cmd/cmd.h b/src/cmd/cmd.h new file mode 100644 index 0000000..ff96b32 --- /dev/null +++ b/src/cmd/cmd.h @@ -0,0 +1,47 @@ +#pragma once +#include <vector> +#include <map> +#include <string> +#include <filesystem> +#include "../rules.h" + +namespace cmd { + // Corresponds to commands + + // Usage gets a category of its own + std::string usage(const std::string& exename); + + // Filesystem operations + std::string list(std::vector<std::string> args); + std::string mkdir(std::vector<std::string> args); + std::string cp(std::vector<std::string> args); + std::string mv(std::vector<std::string> args); + std::string rm(std::vector<std::string> args); + + // Manipulators + std::string heal(std::vector<std::string> args); + std::string damage(std::vector<std::string> args, std::map<std::string, std::string> flags); + std::string attack(std::vector<std::string> args, std::map<std::string, std::string> flags); + std::string save(std::vector<std::string> args, std::map<std::string, std::string> flags); + std::string reset(std::vector<std::string> args); + std::string set(std::vector<std::string> args); + std::string add(std::vector<std::string> args); + std::string del(std::vector<std::string> args); + std::string edit(std::vector<std::string> args); + std::string spellcasting(std::vector<std::string> args); + std::string git(std::vector<std::string> args); + + //Queries + std::string attacks(std::vector<std::string> args); + std::string roll(std::vector<std::string> args); + + // Command-centric helpers + + // Not idempotent: only do once! + std::filesystem::path getTruePath(std::filesystem::path virtPath); + std::vector<std::string> getVirtDirs(void); + + // Helper functions + std::string formatRoll(std::string name, std::string type, int rolled, int bonus); + std::vector<rules::Qualifier> parseQualifiers(std::map<std::string, std::string> flags); +} |