fix: 修复聊天系统编译错误

- 修复 WebSocketManager/SocketIOClient 函数缩进错误
- 重命名 is_connected() 避免与 Object 基类冲突
- 修复 tscn 文件多余前导空格
- 修复测试文件 GUT 断言函数调用
- 添加 GUT 测试框架
This commit is contained in:
WhaleTown Developer
2026-01-08 00:11:12 +08:00
parent 16f24ab26f
commit c8e73bec59
255 changed files with 21876 additions and 91 deletions

View File

@@ -0,0 +1,55 @@
var things = {}
func get_unique_count():
return things.size()
func add_thing_to_count(thing):
if(!things.has(thing)):
things[thing] = 0
func add(thing):
if(things.has(thing)):
things[thing] += 1
else:
things[thing] = 1
func has(thing):
return things.has(thing)
func count(thing):
var to_return = 0
if(things.has(thing)):
to_return = things[thing]
return to_return
func sum():
var to_return = 0
for key in things:
to_return += things[key]
return to_return
func to_s():
var to_return = ""
for key in things:
to_return += str(key, ": ", things[key], "\n")
to_return += str("sum: ", sum())
return to_return
func get_max_count():
var max_val = null
for key in things:
if(max_val == null or things[key] > max_val):
max_val = things[key]
return max_val
func add_array_items(array):
for i in range(array.size()):
add(array[i])