1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 12:48:38 -04:00

Split prices into models

This commit is contained in:
2017-12-04 21:05:17 -05:00
parent 128ea57c4d
commit 5f296e8669
7 changed files with 76 additions and 66 deletions

View File

@ -15,7 +15,7 @@ func luaRegisterPrices(L *lua.LState) {
L.SetField(mt, "__metatable", lua.LString("protected"))
}
func PriceToLua(L *lua.LState, price *Price) *lua.LUserData {
func PriceToLua(L *lua.LState, price *models.Price) *lua.LUserData {
ud := L.NewUserData()
ud.Value = price
L.SetMetatable(ud, L.GetTypeMetatable(luaPriceTypeName))
@ -23,9 +23,9 @@ func PriceToLua(L *lua.LState, price *Price) *lua.LUserData {
}
// Checks whether the first lua argument is a *LUserData with *Price and returns this *Price.
func luaCheckPrice(L *lua.LState, n int) *Price {
func luaCheckPrice(L *lua.LState, n int) *models.Price {
ud := L.CheckUserData(n)
if price, ok := ud.Value.(*Price); ok {
if price, ok := ud.Value.(*models.Price); ok {
return price
}
L.ArgError(n, "price expected")