2011-07-06 10:21:18 +00:00
|
|
|
/*
|
2012-01-23 06:36:15 +00:00
|
|
|
Copyright (C) 2010 Matt King, Birunthan Mohanathas
|
|
|
|
|
2011-07-06 10:21:18 +00:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
2010-12-12 17:08:36 +00:00
|
|
|
|
2011-07-06 10:21:18 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2012-01-23 06:36:15 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2011-07-06 10:21:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LUASCRIPT_H__
|
|
|
|
#define __LUASCRIPT_H__
|
2010-12-12 17:08:36 +00:00
|
|
|
|
|
|
|
#include "lua.hpp"
|
2012-03-09 10:28:25 +00:00
|
|
|
#include "LuaManager.h"
|
2010-12-12 17:08:36 +00:00
|
|
|
|
|
|
|
class LuaScript
|
|
|
|
{
|
|
|
|
public:
|
2012-03-09 10:28:25 +00:00
|
|
|
LuaScript(const char* file);
|
2011-07-06 10:21:18 +00:00
|
|
|
~LuaScript();
|
2010-12-12 17:08:36 +00:00
|
|
|
|
2011-07-06 10:21:18 +00:00
|
|
|
bool IsInitialized() { return m_Initialized; }
|
2012-03-09 10:28:25 +00:00
|
|
|
int GetRef() { return m_Ref; }
|
2010-12-12 17:08:36 +00:00
|
|
|
|
2011-07-06 10:21:18 +00:00
|
|
|
bool IsFunction(const char* funcName);
|
|
|
|
void RunFunction(const char* funcName);
|
2011-08-01 09:08:11 +00:00
|
|
|
int RunFunctionWithReturn(const char* funcName, double& numValue, std::wstring& strValue);
|
2011-07-09 09:23:28 +00:00
|
|
|
void RunString(const char* str);
|
2010-12-12 17:08:36 +00:00
|
|
|
|
|
|
|
protected:
|
2012-03-09 10:28:25 +00:00
|
|
|
int m_Ref;
|
2011-07-06 10:21:18 +00:00
|
|
|
bool m_Initialized;
|
2010-12-12 17:08:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|