コード例 #1
0
 public MeeplePositionedImage(
     Class<? extends Meeple> meepleType,
     FeaturePointer fp,
     ImmutablePoint offset,
     Image sourceImage,
     boolean bridgePlacement) {
   super(fp.getPosition(), offset, sourceImage);
   this.meepleType = meepleType;
   location = fp.getLocation();
   this.bridgePlacement = bridgePlacement;
 }
コード例 #2
0
 // TODO path from Theme
 public String getExtraDecoration(Class<? extends Meeple> type, FeaturePointer fp) {
   if (Follower.class.isAssignableFrom(type) && fp.getLocation().isFarmLocation()) {
     return "farm.png";
   }
   if (fp.getLocation() == Location.TOWER) {
     if (BigFollower.class.isAssignableFrom(type)) {
       return "big_tower.png";
     } else {
       return "tower.png";
     }
   }
   return null;
 }
コード例 #3
0
 private MeeplePositionedImage createMeepleImage(
     Class<? extends Meeple> type, Color c, FeaturePointer fp) {
   Feature feature = getGame().getBoard().get(fp);
   ImmutablePoint offset =
       getClient()
           .getResourceManager()
           .getMeeplePlacement(feature.getTile(), type, fp.getLocation());
   Image image =
       getClient().getFigureTheme().getFigureImage(type, c, getExtraDecoration(type, fp));
   if (fp.getLocation() == Location.ABBOT) {
     image = rotate(image, 90);
   }
   return new MeeplePositionedImage(type, fp, offset, image, feature instanceof Bridge);
 }
コード例 #4
0
 private void rearrangeMeeples(FeaturePointer fp) {
   int order = 0;
   // small followers first
   for (MeeplePositionedImage mi : images) {
     if (mi.location == fp.getLocation() && mi.position.equals(fp.getPosition())) {
       if (mi.meepleType.equals(SmallFollower.class)) {
         mi.order = order++;
       }
     }
   }
   // others on top
   for (MeeplePositionedImage mi : images) {
     if (mi.location == fp.getLocation() && mi.position.equals(fp.getPosition())) {
       if (!mi.meepleType.equals(SmallFollower.class)) {
         mi.order = order++;
       }
     }
   }
 }
コード例 #5
0
 public boolean match(Class<? extends Meeple> meepleType, FeaturePointer fp) {
   if (!meepleType.equals(this.meepleType)) return false;
   if (location != fp.getLocation()) return false;
   if (!position.equals(fp.getPosition())) return false;
   return true;
 }