From fcb052cc8d1abb2e1872c9684bba225686f25b34 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 5 May 2013 14:44:51 +0200 Subject: Added [set/get][build/research[done/enable]] ( ); function fo CBot * setbuild ( ); * setresearchdone ( ); * setresearchenable ( ); * getbuild ( ); * getresearchdone ( ); * getresearchenable ( ); --- src/script/cbottoken.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/script/cbottoken.cpp') diff --git a/src/script/cbottoken.cpp b/src/script/cbottoken.cpp index 6eb6592..2ae2c72 100644 --- a/src/script/cbottoken.cpp +++ b/src/script/cbottoken.cpp @@ -249,6 +249,9 @@ std::string GetHelpFilename(const char *token) if ( strcmp(token, "pow" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/expr.txt"); if ( strcmp(token, "rand" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/expr.txt"); if ( strcmp(token, "abs" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/expr.txt"); + if ( strcmp(token, "getbuild" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/getbuild.txt"); + if ( strcmp(token, "getresearchenable" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/getresen.txt"); + if ( strcmp(token, "getresearchdone" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/getresdo.txt"); if ( strcmp(token, "retobject" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/retobj.txt"); if ( strcmp(token, "search" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/search.txt"); if ( strcmp(token, "radar" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/radar.txt"); @@ -262,7 +265,6 @@ std::string GetHelpFilename(const char *token) if ( strcmp(token, "turn" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/turn.txt"); if ( strcmp(token, "goto" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/goto.txt"); if ( strcmp(token, "grab" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/grab.txt"); - if ( strcmp(token, "buildinfo" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/buildinfo.txt"); if ( strcmp(token, "canbuild" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/canbuild.txt"); if ( strcmp(token, "build" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/build.txt"); if ( strcmp(token, "drop" ) == 0 ) return std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("/cbot/drop.txt"); @@ -368,6 +370,9 @@ bool IsFunction(const char *token) if ( strcmp(token, "pow" ) == 0 ) return true; if ( strcmp(token, "rand" ) == 0 ) return true; if ( strcmp(token, "abs" ) == 0 ) return true; + if ( strcmp(token, "getbuild" ) == 0 ) return true; + if ( strcmp(token, "getresearchenable" ) == 0 ) return true; + if ( strcmp(token, "getresearchdone" ) == 0 ) return true; if ( strcmp(token, "retobject" ) == 0 ) return true; if ( strcmp(token, "search" ) == 0 ) return true; if ( strcmp(token, "radar" ) == 0 ) return true; @@ -382,9 +387,8 @@ bool IsFunction(const char *token) if ( strcmp(token, "turn" ) == 0 ) return true; if ( strcmp(token, "goto" ) == 0 ) return true; if ( strcmp(token, "grab" ) == 0 ) return true; - if ( strcmp(token, "buildinfo" ) == 0 ) return true; - if ( strcmp(token, "canbuild" ) == 0 ) return true; - if ( strcmp(token, "build" ) == 0 ) return true; + if ( strcmp(token, "canbuild" ) == 0 ) return true; + if ( strcmp(token, "build" ) == 0 ) return true; if ( strcmp(token, "drop" ) == 0 ) return true; if ( strcmp(token, "sniff" ) == 0 ) return true; if ( strcmp(token, "receive" ) == 0 ) return true; @@ -453,6 +457,9 @@ const char* GetHelpText(const char *token) if ( strcmp(token, "pow" ) == 0 ) return "pow ( x, y );"; if ( strcmp(token, "rand" ) == 0 ) return "rand ( );"; if ( strcmp(token, "abs" ) == 0 ) return "abs ( value );"; + if ( strcmp(token, "getbuild" ) == 0 ) return "getbuild ( );"; + if ( strcmp(token, "getresearchenable" ) == 0 ) return "getresearchenable ( );"; + if ( strcmp(token, "getresearchdone" ) == 0 ) return "getresearchdone ( );"; if ( strcmp(token, "retobject" ) == 0 ) return "retobject ( );"; if ( strcmp(token, "search" ) == 0 ) return "search ( );"; if ( strcmp(token, "radar" ) == 0 ) return "radar ( cat, angle, focus, min, max, sens );"; @@ -467,7 +474,6 @@ const char* GetHelpText(const char *token) if ( strcmp(token, "turn" ) == 0 ) return "turn ( angle );"; if ( strcmp(token, "goto" ) == 0 ) return "goto ( position, altitude );"; if ( strcmp(token, "grab" ) == 0 ) return "grab ( order );"; - if ( strcmp(token, "buildinfo" ) == 0 ) return "buildinfo ( category );"; if ( strcmp(token, "canbuild" ) == 0 ) return "canbuild ( category );"; if ( strcmp(token, "build" ) == 0 ) return "build ( category );"; if ( strcmp(token, "drop" ) == 0 ) return "drop ( order );"; -- cgit v1.2.3-1-g7c22