本文整理汇总了Java中VASSAL.build.module.map.boardPicker.board.mapgrid.Zone.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Zone.getName方法的具体用法?Java Zone.getName怎么用?Java Zone.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VASSAL.build.module.map.boardPicker.board.mapgrid.Zone
的用法示例。
在下文中一共展示了Zone.getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOldProperties
import VASSAL.build.module.map.boardPicker.board.mapgrid.Zone; //导入方法依赖的package包/类
/**
* Set the Oldxxxx properties related to movement
* @param p
*/
public static void setOldProperties(GamePiece p) {
String mapName = ""; //$NON-NLS-1$
String boardName = ""; //$NON-NLS-1$
String zoneName = ""; //$NON-NLS-1$
String locationName = ""; //$NON-NLS-1$
final Map m = p.getMap();
final Point pos = p.getPosition();
if (m != null) {
mapName = m.getConfigureName();
final Board b = m.findBoard(pos);
if (b != null) {
boardName = b.getName();
}
final Zone z = m.findZone(pos);
if (z != null) {
zoneName = z.getName();
}
locationName = m.locationName(pos);
}
p.setProperty(BasicPiece.OLD_X, String.valueOf(pos.x));
p.setProperty(BasicPiece.OLD_Y, String.valueOf(pos.y));
p.setProperty(BasicPiece.OLD_MAP, mapName);
p.setProperty(BasicPiece.OLD_BOARD, boardName);
p.setProperty(BasicPiece.OLD_ZONE, zoneName);
p.setProperty(BasicPiece.OLD_LOCATION_NAME, locationName);
}
示例2: getPublicProperty
import VASSAL.build.module.map.boardPicker.board.mapgrid.Zone; //导入方法依赖的package包/类
public Object getPublicProperty(Object key) {
if (Properties.KEY_COMMANDS.equals(key)) {
return getKeyCommands();
}
else if (LOCATION_NAME.equals(key)) {
return getMap() == null ? "" : getMap().locationName(getPosition());
}
else if (PIECE_NAME.equals(key)) {
return Decorator.getOutermost(this).getName();
}
else if (CURRENT_MAP.equals(key)) {
return getMap() == null ? "" : getMap().getConfigureName();
}
else if (DECK_NAME.equals(key)) {
return getParent() instanceof Deck ? ((Deck) getParent()).getDeckName() : "";
}
else if (DECK_POSITION.equals(key)) {
if (getParent() instanceof Deck) {
final Deck deck = (Deck) getParent();
final int size = deck.getPieceCount();
final int pos = deck.indexOf(Decorator.getOutermost(this));
return String.valueOf(size - pos + 1);
}
else {
return "0";
}
}
else if (CURRENT_BOARD.equals(key)) {
if (getMap() != null) {
final Board b = getMap().findBoard(getPosition());
if (b != null) {
return b.getName();
}
}
return "";
}
else if (CURRENT_ZONE.equals(key)) {
if (getMap() != null) {
final Zone z = getMap().findZone(getPosition());
if (z != null) {
return z.getName();
}
}
return "";
}
else if (CURRENT_X.equals(key)) {
return String.valueOf(getPosition().x);
}
else if (CURRENT_Y.equals(key)) {
return String.valueOf(getPosition().y);
}
else if (Properties.VISIBLE_STATE.equals(key)) {
return "";
}
Object prop = props == null ? null : props.get(key);
if (prop == null) {
final Map map = getMap();
final Zone zone = (map == null ? null : map.findZone(getPosition()));
if (zone != null) {
prop = zone.getProperty(key);
}
else if (map != null) {
prop = map.getProperty(key);
}
else {
prop = GameModule.getGameModule().getProperty(key);
}
}
return prop;
}