EiTaNBaRiBoA / JsonClassConverter

Simplify your JSON and class interactions! jsonClassConverter effortlessly stores JSON data, converts between JSON and class objects, and instantly loads JSON into usable classes. Streamline your development and data handling with this essential tool.
MIT License
48 stars 2 forks source link

Question on serialising classes #4

Closed MatthewHinds closed 2 months ago

MatthewHinds commented 2 months ago

Hi there. I noticed your documentation mentioning you need to annotate properties with @export. How would you achieve the following as Godot does not allow classes to be exported.

Example code:

class_name PlayerData
@export var inventory : Inventory
@export var skills : Skills

I'm currently using my own implementation of a JSON serialiser and stumbled upon your repo here. So I'm wondering if the above is possible. Thanks

EiTaNBaRiBoA commented 2 months ago

Hi there. I noticed your documentation mentioning you need to annotate properties with @export. How would you achieve the following as Godot does not allow classes to be exported.

Example code:

class_name PlayerData
@export var inventory : Inventory
@export var skills : Skills

I'm currently using my own implementation of a JSON serialiser and stumbled upon your repo here. So I'm wondering if the above is possible. Thanks

Yes, it does. The latest commit adds support for nested resources, along with existing support for multi-nested objects.