RPTools.net

Discussion and Support

Skip to content

It is currently Mon Sep 25, 2017 2:49 am 






Reply to topic  [ 4 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Cave Troll
 
Joined: Fri Jan 17, 2014 9:13 pm
Posts: 36
 Post subject: Token knowing its zone
PostPosted: Thu Jan 30, 2014 9:31 am 
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.

_________________
Virenerus' MapTools fork - Tiamat Build


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7861
Location: Bay Area
 Post subject: Re: Token knowing its zone
PostPosted: Thu Jan 30, 2014 10:37 am 
Out of curiosity, is the term "zone" a java thing or do you mean the token layer?

_________________
Downloads:


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Fri Jan 17, 2014 9:13 pm
Posts: 36
 Post subject: Re: Token knowing its zone
PostPosted: Thu Jan 30, 2014 10:52 am 
Zone / Zonerenderer is the representation of a map in the code.

_________________
Virenerus' MapTools fork - Tiamat Build


Top
 Profile  
 
 Offline
Dragon
 
Joined: Wed Oct 19, 2011 1:07 am
Posts: 958
 Post subject: Re: Token knowing its zone
PostPosted: Thu Jan 30, 2014 2:19 pm 
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 :lol:

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 4 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman