Hi,
I was wondering if there was a recommended/best practice method of setting up data that has a parent/child type relationship to it. To give an example of what I mean, let's say I have a catalog and in the catalog are three items, 'street', 'city' and 'country'. When a player/character is created they are assigned the street from the catalog that has custom data added to it, a city that the street exists in and a country that the city exists in.
So, their street item has json data with 'ownercity' and their city has a field with 'ownercountry'. i.e.
Street {
"StreetName": "Anywhere Street",
"OwnerCity": "Capital City" }
City {
"CityName": "Capital City",
"OwnerCountry": "Anywhereistan" }
Country {
"CountryName": "Anywhereistan"
"OwnerCharacter": "MyCharacter" }
Is this the best way to handle such a situation or is there another way to arrange catalog items that would be better/easier. Keep in mind that there are a few pieces of custom data in the catalog but for the most part things get thoroughly customized once they are created/assigned to a character. Also, if it makes a difference, the relationship between street/city is constant but ownership by character can change based on gameplay.
I have initially been thinking this as the way to set things up but it also feels like maybe it is unnecessarily difficult. Would a better method for keeping this relationship between the items be to assign a tag to them and operate on that?
I know this is kind of an odd/open-ended question; just don't want to reinvent the wheel if someone has seen or knows of a better way to do this.
Thanks in advance!