Add IsNumber

This commit is contained in:
Sky Johnson 2025-02-03 18:55:34 -06:00
parent 229884ba97
commit c74ad4bbc9

View File

@ -186,6 +186,7 @@ func (s *State) toValueUnsafe(index int) (interface{}, error) {
func (s *State) GetType(index int) LuaType { return LuaType(C.lua_type(s.L, C.int(index))) } func (s *State) GetType(index int) LuaType { return LuaType(C.lua_type(s.L, C.int(index))) }
func (s *State) IsString(index int) bool { return s.GetType(index) == TypeString } func (s *State) IsString(index int) bool { return s.GetType(index) == TypeString }
func (s *State) IsNumber(index int) bool { return s.GetType(index) == TypeNumber }
func (s *State) IsFunction(index int) bool { return s.GetType(index) == TypeFunction } func (s *State) IsFunction(index int) bool { return s.GetType(index) == TypeFunction }
func (s *State) IsTable(index int) bool { return s.GetType(index) == TypeTable } func (s *State) IsTable(index int) bool { return s.GetType(index) == TypeTable }
func (s *State) ToBoolean(index int) bool { return C.lua_toboolean(s.L, C.int(index)) != 0 } func (s *State) ToBoolean(index int) bool { return C.lua_toboolean(s.L, C.int(index)) != 0 }