> -----Original Message-----
> From:
[messages-bounces@vassalengine.org](mailto:messages-bounces@vassalengine.org)
> [mailto:
[messages-bounces@vassalengine.org](mailto:messages-bounces@vassalengine.org)] On Behalf Of Brent Easton
> Sent: September 16, 2010 6:31 PM
> To:
[messages@vassalengine.org](mailto:messages@vassalengine.org)
> Subject: Re: [messages] [Developers] Re: question about piece movement
>
> Hi Ken,
>
> 1. If a piece has Hideable traits, but is not invisible to
> me, then it previously returned Boolean.FALSE. With your
> changes, it will now return null. If any module is
> specifically checking that INVISIBLE_TO_ME != Boolean.FALSE,
> it will now fail. Unlikely, but possible.
>
> 2. Yes, INVISIBLE_TO_OTHER would definitely need to do
> whatever INVISIBLE_TO_ME does.
>
> 3. I think VISIBLE_STAT is fine, it already builds a state
> from all traits in the counter.
>
> 4. HIDDEN_BY is problem also, only the top Hideable is ever exposed.
>
> 5. Yes, getLocalizedProperty() should use the same algorithm
> to calculate a given property.
>
> 6. There are performance implications of this change. The
> Invisibility properties used to be completely satisified by
> the top-most Hideable trait (often one of the top-most
> change). This change will require a full search through the
> entire trait stack in case there are additional Hideable
> traits. You may find that modules with extremely heavy trait
> per piece counts with an Invisible on top notice a
> performance hit. [NOTE that this is already an issue where
> there is NO Hideable trait at all in the Piece stack, we
> still have to search the entire getProperty() train every
> time to find that there is not Hideable trait. ]
>
> Regards,
> Brent.
>
> *********** REPLY SEPARATOR �***********
>
> On 15/09/2010 at 8:19 PM fil512 �wrote:
>
> >Hey Brent,
> >
> >Guess you've been too busy to review my code change. �To
> make it easier
> >for you, here's the method in Hideable.java that I changed.
> >
> >
> >Code:
> > �public Object getProperty(Object key) {
> > � �if (HIDDEN_BY.equals(key)) {
> > � � �return hiddenBy;
> > � �}
> > � �else if (Properties.INVISIBLE_TO_ME.equals(key) &&
> invisibleToMe())
> >{
> > � � �return Boolean.TRUE;
> > � �}
> > � �else if (Properties.INVISIBLE_TO_OTHERS.equals(key)) {
> > � � �return invisibleToOthers() ? Boolean.TRUE : Boolean.FALSE;
> > � �}
> > � �else if (Properties.VISIBLE_STATE.equals(key)) {
> > � � � �return String.valueOf(invisibleToOthers()) +
> > � � � � � � � invisibleToMe() + piece.getProperty(key);
> > � � �}
> > � �else {
> > � � �return super.getProperty(key);
> > � �}
> > �}
> >
> >
> >
> >The behaviour that I changed was INVISIBLE_TO_ME no longer
> stops at the
> >first Hideable trait, but rather cascades through all traits
> performing
> >an "or" operation, so that if at least one of the traits
> says I should
> >be invisible, then I will be invisible. �This resolves bug 2921 as
> >reported. �I have a couple of concerns about my fix though.
> >
> >1) Should the behaviour of getLocalizedProperty() match that of
> >getProperty() ?
> >2) If INVISIBLE_TO_ME behaves this way, should others work
> this way as
> >well (e.g. INVISIBLE_TO_OTHERS and VISIBLE_STATE) ?
> >
> >Thanks for your help!
> >Ken
>
>
>
> _______________________________________________
> messages mailing list
>
[messages@vassalengine.org](mailto:messages@vassalengine.org)
>
[vassalengine.org/mailman/listinfo/messages](http://www.vassalengine.org/mailman/listinfo/messages)
>
>
_______________________________________________
messages mailing list
[messages@vassalengine.org](mailto:messages@vassalengine.org)
[vassalengine.org/mailman/listinfo/messages](http://www.vassalengine.org/mailman/listinfo/messages)