From 90626c9d78bb10c6aca09388e83f4aa31aa08960 Mon Sep 17 00:00:00 2001 From: godotg Date: Sat, 5 Apr 2025 21:57:36 +0800 Subject: [PATCH] chore[gdscript]: dictionary generic type support --- .../src/main/resources/gdscript/ProtocolManagerTemplate.gd | 4 ++-- protocol/src/test/gdscript/zfoogd/ProtocolManager.gd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/protocol/src/main/resources/gdscript/ProtocolManagerTemplate.gd b/protocol/src/main/resources/gdscript/ProtocolManagerTemplate.gd index 8465fbf1..f8ae4f9c 100644 --- a/protocol/src/main/resources/gdscript/ProtocolManagerTemplate.gd +++ b/protocol/src/main/resources/gdscript/ProtocolManagerTemplate.gd @@ -1,7 +1,7 @@ ${protocol_imports} -static var protocols: Dictionary = {} -static var protocolClassMap: Dictionary = {} +static var protocols: Dictionary[int, RefCounted] = {} +static var protocolClassMap: Dictionary[int, Object] = {} static func initProtocol(): ${protocol_manager_registrations} diff --git a/protocol/src/test/gdscript/zfoogd/ProtocolManager.gd b/protocol/src/test/gdscript/zfoogd/ProtocolManager.gd index 945efa9c..f260ada6 100644 --- a/protocol/src/test/gdscript/zfoogd/ProtocolManager.gd +++ b/protocol/src/test/gdscript/zfoogd/ProtocolManager.gd @@ -6,8 +6,8 @@ const ObjectA = preload("res://zfoogd/packet/ObjectA.gd") const ObjectB = preload("res://zfoogd/packet/ObjectB.gd") const SimpleObject = preload("res://zfoogd/packet/SimpleObject.gd") -static var protocols: Dictionary = {} -static var protocolClassMap: Dictionary = {} +static var protocols: Dictionary[int, RefCounted] = {} +static var protocolClassMap: Dictionary[int, Object] = {} static func initProtocol(): protocols[0] = EmptyObject.EmptyObjectRegistration.new()