コード例 #1
0
ファイル: Map.java プロジェクト: nzyuzin/CandideRL
 private MapCell[][] getPartOfMap(Position pos, int width, int height) {
   return getPartOfMap(
       pos.getX() - (int) Math.floor(width / 2.0),
       pos.getX() + (int) Math.ceil(width / 2.0),
       pos.getY() - (int) Math.floor(height / 2.0),
       pos.getY() + (int) Math.ceil(height / 2.0));
 }
コード例 #2
0
ファイル: Map.java プロジェクト: nzyuzin/CandideRL
 public void setCell(Position pos, MapCell cell) {
   setCell(pos.getX(), pos.getY(), cell);
 }
コード例 #3
0
ファイル: Map.java プロジェクト: nzyuzin/CandideRL
 public MapCell getCell(Position pos) {
   return getCell(pos.getX(), pos.getY());
 }
コード例 #4
0
ファイル: Map.java プロジェクト: nzyuzin/CandideRL
 private Position getRandomPositionInsideMap() {
   Random rand = new Random();
   return Position.getInstance(rand.nextInt(mapWidth - 2) + 1, rand.nextInt(mapHeight - 2) + 1);
 }