Commits

Adam Martin  committed 935ae58

Merged

  • Participants
  • Parent commits 711745d

Comments (0)

Files changed (2)

File src/ScriptCore/ScriptCoreCodingFinal.docx

Binary file removed.

File src/ScriptCore/ScriptCoreCodingFinal.h

+#pragma once
+
+#include "../CoreInterface.h"
+#include "../GlobalProperties.h"
+
+extern "C"
+{
+	  #include <lua.h>
+	  #include <lualib.h>
+	  #include <lauxlib.h>
+}
+
+#pragma comment( lib, “lua.lib”)
+#pragma comment( lib, “lualib.lib”)
+
+class ScriptCore : public CoreInterface
+{
+public:
+	ScriptCore(GlobalProperties* gprops, MessageDispatcher* msghndlr) : CoreInterface(gprops, msghndlr) 
+	{
+		this->gprops->AddProperty(“screenwidth”, 1024);
+		this->gprops->AddProperty(“screenheight”, 768);
+	}
+	~ScriptCore() 
+	{
+
+	}
+	void Message(int msg, EnvelopeAny* e) {
+
+	}
+
+	void CreateComponent(std::string type, std::map< std::string, std::string > &attributes, Entity* e) {
+
+	}
+
+	bool Startup(void) 
+	{
+		lua_State* pL = lua_open();
+
+		luaopen_base(pL);
+		luaopen_math(pL);
+		luaopen_io(pL);
+
+		/*if (int error = (lua_State*pL=luaopen() ) !=0)
+		{
+std::cout <<"\n[c++]:  ERROR(" << error << "): Problem with Lua"
+				      <<"script file\n\n"  <<std::endl;
+		return false;
+		}  I think this is the routine which would check to see if Lua loaded correctly.  I adapted it from a routing in the Buckland text.
+I've remarked it out for now until I can verify I did it right.  */
+		return true;
+	}
+
+	void Shutdown (void) 
+	{
+		lua_shutDown(void);
+		lua_close();
+		//end
+	}
+
+	void Update(double dt) 
+	{
+//CreateComponent(FileName);  We have to find out what the //general purpose variable for this will be.
+	}
+
+	void Pause() 
+	{
+
+	}
+
+	void Resume() 
+	{
+
+	}
+
+	void RegisterComponent(ComponentInterface* comp) 
+	{
+
+	}
+};
+