Hey. While going through the API I found the token does not actually know on which zone it is. Most functions that want to get the zone of a layer just use the current one. Is there a particular reason for it? Any serialization that does not support cyclical references or something?
Would be cool if someone knows this.
Thanks guys.
Token knowing its zone
Moderators: dorpond, trevor, Azhrei
Re: Token knowing its zone
Out of curiosity, is the term "zone" a java thing or do you mean the token layer?
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Token knowing its zone
Zone / Zonerenderer is the representation of a map in the code.
Re: Token knowing its zone
I think you most likely saw that each zone is aware of what tokens are on it. When it serializes it carries the token's GUID (I think). A token is not aware of what zone it's in because a copy of the token can exist on different zones, even library types (even if that would cause crazy **** to happen), making it a dubious field to have. I'm not saying it's the right way, and heaven knows how horrible the token search methodology is in the main source (i.e. iterate through zones, iterate through tokens within the zone). What's worse is, with this scheme, copies of a token found in other zones do not get updated when the token's model changes.
You're likely going to rewrite/refactor the models like I did, so good luck with that
Again, a better "token" architecture has been discussed for 2.0 where there is only one instance of the model, and potentially many copies of its image asset across all maps. Search the forums, if you're interested.
You're likely going to rewrite/refactor the models like I did, so good luck with that
Again, a better "token" architecture has been discussed for 2.0 where there is only one instance of the model, and potentially many copies of its image asset across all maps. Search the forums, if you're interested.
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in