LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
luaccolor.h
1 #ifndef LUACCOLOR_H
2 #define LUACCOLOR_H
3 
4 #include <string>
5 #include <lua.hpp>
6 #include "luacudata.h"
7 #include "core/color.h"
8 
10 
14 namespace LuaC {
16  const std::string colorMeta = "LPC.Color";
18  const std::string colorClass = "Color";
20  template<>
21  const std::string UdataLib<Color>::mMetaTable = colorMeta;
25  class ColorLib : public UdataLib<Color> {
26  public:
28  static int luaopen_color(lua_State *l);
29 
30  private:
32  static const luaL_reg luaColorLib[];
34  static int newColor(lua_State *l);
36  static int getR(lua_State *l);
37  static int getG(lua_State *l);
38  static int getB(lua_State *l);
40  static int set(lua_State *l);
42  static int newIndex(lua_State *l);
44  static int setR(lua_State *l);
45  static int setG(lua_State *l);
46  static int setB(lua_State *l);
48  static int equality(lua_State *l);
49  static int toString(lua_State *l);
50  static int concat(lua_State *l);
57  static void concatWithString(lua_State *l, int cIdx, int sIdx);
58  };
59 }
60 
61 #endif