[messages] [Technical Support & Bugs] Re: Programming tutorial - MyCounterFactory.class

Tim M timothy.mccarron at sbcglobal.net
Fri Jan 27 07:15:33 MST 2012


yeah - Im not surprised. We do have a problem with that stuff, theres a
bug with the Zap tutorial stuff (can't find it at the moment) :)

What you might want to do is try this instead (a custom command encoder
that extends BasicCommandEncoder)

example that adds two traits in my module:

public class CCCommandEncoder extends BasicCommandEncoder {

  public Decorator createDecorator(String type, GamePiece inner) {
      if (type.startsWith(CalculatedProperty.ID)) {     
      return new CalculatedProperty(type, inner);
    }
    else (type.startsWith(CCInfo.ID)) {     
      return new CCInfo(type, inner);
    }
    return super.createDecorator(type, inner);
  }
}

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=30116#p30116


More information about the messages mailing list