コード例 #1
0
 public Position getPosition(final IndexPosition key, final Player access) throws GameException {
   if ((key.getCurveIndex() >= 0) && (key.getCurveIndex() < NUM_ROWS))
     return basePosition
         .add(rowOffset.scale(key.getCurveIndex()))
         .add(columnOffset.scale(key.getCardIndex()));
   else if (CURVE_CMDS == key.getCurveIndex())
     return cmdPosition.add(cmdOffset.scale(key.getCardIndex()));
   else return _mplayerManager.getPosition(key, access);
 }
コード例 #2
0
 boolean isAdjacent(final IndexPosition position, final IndexPosition prevPosition) {
   if (null == position) return false;
   if (null == prevPosition) return false;
   if (position.getCurveIndex() + 1 < prevPosition.getCurveIndex()) return false;
   if (position.getCurveIndex() - 1 > prevPosition.getCurveIndex()) return false;
   if (position.getCardIndex() + 1 < prevPosition.getCardIndex()) return false;
   if (position.getCardIndex() - 1 > prevPosition.getCardIndex()) return false;
   final boolean curveMatch = position.getCurveIndex() == prevPosition.getCurveIndex();
   final boolean cardMatch = position.getCardIndex() == prevPosition.getCardIndex();
   if (curveMatch && cardMatch) return true;
   if (curveMatch || cardMatch) return true;
   return true;
 }
コード例 #3
0
 BoardToken getGenerateToken(
     final int chainSize, final MarkovPredictor mk, final TokenArray a, final IndexPosition p) {
   return getGenerateToken(
       chainSize, mk, a, a.new ArrayPosition(p.getCurveIndex(), p.getCardIndex()));
 }