aboutsummaryrefslogtreecommitdiffstats
path: root/src/brice.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-07-23 10:47:10 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-07-23 10:47:10 -0400
commit9e540db7d6492168cadcafddbf145ffdd7b21981 (patch)
tree8019a7a67e66a5ec87ad7872278e8ee92431251a /src/brice.cpp
parent215e5ee6ce089c3e0d5be28fd816bc7031b6acab (diff)
source cleanup; beginning of custom attacks
Diffstat (limited to 'src/brice.cpp')
-rw-r--r--src/brice.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/brice.cpp b/src/brice.cpp
index 8cbd9bb..ad4ea95 100644
--- a/src/brice.cpp
+++ b/src/brice.cpp
@@ -4,15 +4,16 @@
#include <string>
#include <fstream>
#include <istream>
+#include <sstream>
#include <common.hpp>
#include <error.hpp>
#include <fileio.hpp>
-extern std::vector<std::string> StringTokenizer(const std::string& str, char delim);
-
static std::unordered_map<std::string, std::string> brice;
+std::vector<std::string> StringTokenizer(const std::string& str, char delim);
+
namespace game {
bool canJump;
bool canSprint;
@@ -105,3 +106,16 @@ namespace game {
setValue("canSprint", std::to_string(canSprint));
}
}
+
+std::vector<std::string> StringTokenizer(const std::string& str, char delim)
+{
+ std::vector<std::string> tokens;
+ std::istringstream is (str);
+ std::string token;
+
+ while (getline(is, token, delim))
+ tokens.emplace_back(token);
+
+ return tokens;
+}
+