0 votes

Hello gyus!
How I can get access to variables of class?

Some example:
I have class:

   class DataJutsu:
        var id:int
        var level:int
        var type:int
        var name:String
        var descr:String
        var chakra:int
        var rank:String
        var background:String
        var element:String

Now i need to get acces to all class variables for next operation:

    for elem in self.get_property_list():
        elem = dict.values()[i] #setting a value to a class varaible

Where self = MyClass object.
If yu know java it something like reflections Field.get and Field.set

Thank you!

in Engine by (37 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.