Re: Lua <-> AI Generalised message standard proposal
Posted: 10 Jun 2011, 01:06
I have attached a basic Lua parser class for C++.
Currently it only parses and error checks the replies section. I am still a little unsure of how you want to do the messages and the error section exactly.
Steps to use:
1)Include the header file.
2)Create a LuaParser object
3)Access the replies, messages or errors vectors from the LuaParser object
Example:
Currently it only parses and error checks the replies section. I am still a little unsure of how you want to do the messages and the error section exactly.
Steps to use:
1)Include the header file.
2)Create a LuaParser object
3)Access the replies, messages or errors vectors from the LuaParser object
Example:
Code: Select all
string testVar ="{replies = {{returned=\"success\"},{returned=\"failure\",}}}";
LuaParser testParser(testVar);
for(int i =0;i < testParser.replies.size();i++)
{
cout<< i<<" Reply Returned value is: " << testParser.replies[i] <<endl;
}
for(int i =0;i < testParser.messages.size();i++)
{
cout<< i<<" mesage is: " << testParser.messages[i] <<endl;
}
for(int i =0;i < testParser.errors.size();i++)
{
cout<< i<<" Error is: " << testParser.errors[i] <<endl;
}