From 202b5a75428b2405eeff3080cde0e657b76978f9 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 11 Feb 2017 11:36:09 -0500 Subject: string token iterator --- src/quest.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/quest.cpp') diff --git a/src/quest.cpp b/src/quest.cpp index 8fd786e..a0f9a6d 100644 --- a/src/quest.cpp +++ b/src/quest.cpp @@ -1,7 +1,8 @@ #include #include -#include + +#include void QuestSystem::update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) { @@ -12,7 +13,13 @@ void QuestSystem::update(entityx::EntityManager &en, entityx::EventManager &ev, int QuestSystem::assign(std::string title, std::string desc, std::string req) { - (void)req; + for (auto s : tokens(req, ',')) { + s.erase(std::remove_if(s.begin(), s.end(), + [](char c) { return isspace(c); }), s.end()); + + std::cout << s << '\n'; + } + current.emplace_back(title, desc); return 0; } -- cgit v1.2.3