Skip to content

Prototypes and data #190

@kd7uiy

Description

@kd7uiy

I've been working on reducing the number of translation fails for en_US in a wide variety of situations. One of the more interesting one was in the BuildMode Controller, which has a tooltip for the number of resources. The items are stored there by the item name, which is not the same as the localization name (At least, not now). I started walking down the pathway of how I would get the localization name of an inventory, and discovered what in my mind seems to be a mess.

The problem we have right now is there are 2 pathways to getting such data. A Prototype inventory is stored with the prototype manager, which is probably what I wanted anyways, I could just find the right inventory prototype and get the right data. But looking more in to it, I discovered that every single inventory object stores ALL of the data in the inventory. So if we have 1000 stacks of iron, then each one of them stores the max stack size, localization name, and other data that doesn't really seem to be required. In addition, the prototype stores a blank reference to a tile, which isn't really needed. In my mind, all that an individual tile should store is the item key, current stack size, and where it is at. The data structure should have all of the rest. That should be pretty easy to access, however we go about doing so.

This ends up being a whole lot of duplicate data, all over the place. It seems like all of the prototypes do this to some extent.

Is this what we really want?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions