Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Ref Serializer

An asset by KoBeWi
The page banner background of a mountain and forest
Ref Serializer hero image

Quick Information

0 ratings
Ref Serializer icon image
KoBeWi
Ref Serializer

Utility class for registering and serializing light-weight RefCounted-based structs. It can be used as a replacement for Resources; it comes with its advantages and limitations.Register a type with:RefSerializer.register_type(&"ClassName", YourClass.new)Where ClassName is the name used to create and serialize the type and YourClass.new is a constructor Callable, which will be used to create instances of your class. YourClass can be any class, including custom internal classes. It needs to extend RefCounted.Create instances with:RefSerializer.create_object(&"ClassName")It returns an instance of your class created with the provided constructor method.Serialize with:RefSerializer.serialize_object(some_object)where some_object is an instance created with create_object() or deserialized using deserialize_object(). The methods returns a Dictionary that represents your object.Or use store methods:RefSerializer.save_as_text(some_object, "res://object.txt")RefSerializer.save_as_binary(some_object, "res://object.not_txt")Check the repository README for more details.

Supported Engine Version
4.2
Version String
1.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Utility class for registering and serializing light-weight RefCounted-based structs. It can be used as a replacement for Resources; it comes with its advantages and limitations.

Register a type with:
RefSerializer.register_type(&"ClassName", YourClass.new)
Where ClassName is the name used to create and serialize the type and YourClass.new is a constructor Callable, which will be used to create instances of your class. YourClass can be any class, including custom internal classes. It needs to extend RefCounted.

Create instances with:
RefSerializer.create_object(&"ClassName")
It returns an instance of your class created with the provided constructor method.

Serialize with:
RefSerializer.serialize_object(some_object)
where some_object is an instance created with create_object() or deserialized using deserialize_object(). The methods returns a Dictionary that represents your object.

Or use store methods:
RefSerializer.save_as_text(some_object, "res://object.txt")
RefSerializer.save_as_binary(some_object, "res://object.not_txt")

Check the repository README for more details.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Ref Serializer icon image
KoBeWi
Ref Serializer

Utility class for registering and serializing light-weight RefCounted-based structs. It can be used as a replacement for Resources; it comes with its advantages and limitations.Register a type with:RefSerializer.register_type(&"ClassName", YourClass.new)Where ClassName is the name used to create and serialize the type and YourClass.new is a constructor Callable, which will be used to create instances of your class. YourClass can be any class, including custom internal classes. It needs to extend RefCounted.Create instances with:RefSerializer.create_object(&"ClassName")It returns an instance of your class created with the provided constructor method.Serialize with:RefSerializer.serialize_object(some_object)where some_object is an instance created with create_object() or deserialized using deserialize_object(). The methods returns a Dictionary that represents your object.Or use store methods:RefSerializer.save_as_text(some_object, "res://object.txt")RefSerializer.save_as_binary(some_object, "res://object.not_txt")Check the repository README for more details.

Supported Engine Version
4.2
Version String
1.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers