GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
532 stars 76 forks source link

Add parsing of nested Dictionaries/Arrays #80

Closed timjrobinson closed 3 years ago

timjrobinson commented 3 years ago

This works with the following test object I was trying to save to firestore:

var islandData = {
    'ground': [
        {
            'x': 0,
            'y': 0
        },
        {
            'x': 1,
            'y': 0
        }
    ],
    'towers': [
        {
            'x': 0,
            'y': 0,
            'upgrades': []
        },
        {
            'x': 1,
            'y': 0,
            'upgrades': [
                {
                    'id': 'flamethrower',
                    'level': 2,
                    'attachpos': 'main'
                }
            ]
        }
    ]
}
fenix-hub commented 3 years ago

Hi @timjrobinson , Is there a specific reason you would like to implement the array2fields method? Are you having issues creating a dictionary of fields? Or is it limiting your flow in any way?

timjrobinson commented 3 years ago

@fenix-hub Just updated with test item that wasn't saving to Firestore. The new code saves it out correctly.

fenix-hub commented 3 years ago

@timjrobinson Maybe old changes broke compatibilty with Arrays. Thank you very much for your PR. It will be merged together with a little update with the Authentication module, later today.

Always feel free to contribute, but please always mention what is the issue you are encountering that your PRs will resolve, so we will be able to test them too and merge them faster. Thank you! :)

timjrobinson commented 3 years ago

Sure will do, thanks!