!quit function

This commit is contained in:
jacob1
2012-10-20 16:02:42 -04:00
committed by Simon Robertshaw
parent 5ef6bd8507
commit 3ad7cf4539
2 changed files with 12 additions and 0 deletions

View File

@@ -82,6 +82,8 @@ ValueType TPTScriptInterface::testType(std::string word)
return TypeFunction;
else if(word == "bubble")
return TypeFunction;
else if(word == "quit")
return TypeFunction;
//Basic type
parseNumber:
for(i = 0; i < word.length(); i++)
@@ -129,6 +131,8 @@ AnyType TPTScriptInterface::eval(std::deque<std::string> * words)
return tptS_reset(words);
else if(word == "bubble")
return tptS_bubble(words);
else if(word == "quit")
return tptS_quit(words);
break;
case TypeNumber:
return NumberType(atoi(rawWord));
@@ -467,6 +471,13 @@ AnyType TPTScriptInterface::tptS_reset(std::deque<std::string> * words)
return NumberType(0);
}
AnyType TPTScriptInterface::tptS_quit(std::deque<std::string> * words)
{
ui::Engine::Ref().Exit();
return NumberType(0);
}
TPTScriptInterface::~TPTScriptInterface() {
}

View File

@@ -20,6 +20,7 @@ protected:
AnyType tptS_load(std::deque<std::string> * words);
AnyType tptS_reset(std::deque<std::string> * words);
AnyType tptS_bubble(std::deque<std::string> * words);
AnyType tptS_quit(std::deque<std::string> * words);
ValueType testType(std::string word);
public:
TPTScriptInterface(GameController * c, GameModel * m);