[Dev] how do I use an AssetDictionary?

Brian Fisher brian at hamsterrepublic.com
Thu Apr 10 20:35:23 PDT 2008


The idea is to do something like this:
-------------------------------
class HasDictProperty(AssetBase):
    myDict = AssetDict(AssetObject(ObjectInDict))

-----
and then you could access myDict on an instance of HasDictProperty
just as a normal dictionary. However I never made it work in that I
never made the editor understand it and I never made anything that
tests it really.

For the editor, the idea is it would provide areas to enter keys and
delete entries and all that, and would create the appropriate editor
for the element in the dictionary based on the AssetType specified as
an argument to the AssetDict property descriptor (i.e. in the case
above it would make an editor that let you edit the properties of the
ObjectInDict instance in the dictionary)

For testing it's functionality, I would expect it saves and loads no
problem, and that code access of the Dict works just fine - I just
haven't really proofed it out to say 100% that it would.


On Thu, Apr 10, 2008 at 8:07 PM, James Paige <Bob at hamsterrepublic.com> wrote:
> Hey, Brian. How does the AssetDictionary work? I would like to store an
>  asset with a property that contains a dictionary of Tile assets with
>  (x,y) tuples as the keys.
>
>  ---
>  James
>  _______________________________________________
>  Dev mailing list
>  Dev at lists.motherhamster.org
>  http://lists.motherhamster.org/listinfo.cgi/dev-motherhamster.org
>



More information about the Dev mailing list