/*
** Lua binding: shop
** Generated automatically by tolua++-1.0.92 on 12/01/14 13:15:13.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
TOLUA_API int  tolua_shop_open (lua_State* tolua_S);

#include "..\luasample1.h"

/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
}

/* function: GetItemName */
#ifndef TOLUA_DISABLE_tolua_shop_GetItemName00
static int tolua_shop_GetItemName00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  int index = ((int)  tolua_tonumber(tolua_S,1,0));
  {
   const char* tolua_ret = (const char*)  GetItemName(index);
   tolua_pushstring(tolua_S,(const char*)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'GetItemName'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: GetItemPrice */
#ifndef TOLUA_DISABLE_tolua_shop_GetItemPrice00
static int tolua_shop_GetItemPrice00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  int index = ((int)  tolua_tonumber(tolua_S,1,0));
  {
   int tolua_ret = (int)  GetItemPrice(index);
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'GetItemPrice'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: GetSelection */
#ifndef TOLUA_DISABLE_tolua_shop_GetSelection00
static int tolua_shop_GetSelection00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isstring(tolua_S,1,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* title = ((const char*)  tolua_tostring(tolua_S,1,0));
  {
   int tolua_ret = (int)  GetSelection(title);
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'GetSelection'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: AddItem */
#ifndef TOLUA_DISABLE_tolua_shop_AddItem00
static int tolua_shop_AddItem00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isstring(tolua_S,1,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* name = ((const char*)  tolua_tostring(tolua_S,1,0));
  int price = ((int)  tolua_tonumber(tolua_S,2,0));
  {
   bool tolua_ret = (bool)  AddItem(name,price);
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'AddItem'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* get function: g_money */
#ifndef TOLUA_DISABLE_tolua_get_g_money
static int tolua_get_g_money(lua_State* tolua_S)
{
  tolua_pushnumber(tolua_S,(lua_Number)g_money);
 return 1;
}
#endif //#ifndef TOLUA_DISABLE

/* set function: g_money */
#ifndef TOLUA_DISABLE_tolua_set_g_money
static int tolua_set_g_money(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
  tolua_Error tolua_err;
  if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
   tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
#endif
  g_money = ((int)  tolua_tonumber(tolua_S,2,0))
;
 return 0;
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
TOLUA_API int tolua_shop_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,1);
 tolua_beginmodule(tolua_S,NULL);
  tolua_function(tolua_S,"GetItemName",tolua_shop_GetItemName00);
  tolua_function(tolua_S,"GetItemPrice",tolua_shop_GetItemPrice00);
  tolua_function(tolua_S,"GetSelection",tolua_shop_GetSelection00);
  tolua_function(tolua_S,"AddItem",tolua_shop_AddItem00);
  tolua_variable(tolua_S,"g_money",tolua_get_g_money,tolua_set_g_money);
  tolua_constant(tolua_S,"MAX_SHOP_ITEMS",MAX_SHOP_ITEMS);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 TOLUA_API int luaopen_shop (lua_State* tolua_S) {
 return tolua_shop_open(tolua_S);
};
#endif

