亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? castleinfinity.java

?? good project for programmer,,
?? JAVA
?? 第 1 頁 / 共 4 頁
字號(hào):
    //make the polygons    int outRadius = 60;    int inRadius = 40;    Polygon[] parts = new Polygon[4];    double angle = 0;    for(int index = 0; index < 4; index += 1) {      int[] xpoints = new int[6];      int[] ypoints = new int[6];      for(int i = 0; i < 6; i += 1) {        xpoints[i] = (int)(c.x + castleRadii[i]*Math.cos(angle + castleAngles[i]));        ypoints[i] = (int)(c.y + castleRadii[i]*Math.sin(angle + castleAngles[i]));      }      parts[index] = new Polygon(xpoints, ypoints, 6);      angle += Math.PI/2;    }    castles[castleIndex] = parts;    removeHexagon(p);    //find the hexagons the castle now borders    Polygon[] surroundingHexagons = new Polygon[6];    for(int i = 0; i < 6; i += 1) {      Polygon nearest = null;      Point guessedCenter = new Point((int)(c.x + hexRad*Math.sqrt(3)*Math.cos(i*Math.PI/3)),                                      (int)(c.y + hexRad*Math.sqrt(3)*Math.sin(i*Math.PI/3)));      double shortestGap = 10000;      Integer index = null;      for(int j = 0; j < countryPolygons.size(); j += 1) {        Polygon thePolygon = (Polygon)countryPolygons.get(j);        Point center = polygonCenter(thePolygon);        double gap = dist(guessedCenter, center);        if(gap < shortestGap) {          shortestGap = gap;          nearest = thePolygon;        }      }      surroundingHexagons[i] = nearest;    }    //adjust the shapes of the hexagons the castle intrudes onto    Rectangle castleBounds = new Rectangle(c.x - cOR, c.y - cOR, cOR*2, cOR*2);    Polygon hex;    hex = surroundingHexagons[0];    for(int i = 0; i < hex.npoints; i += 1) {      if(castleBounds.contains(hex.xpoints[i], hex.ypoints[i]) && hex.ypoints[i] > c.y) {        hex.xpoints[i] = c.x + cOR;        hex.ypoints[i] = (int)(c.y + cOR*Math.tan(Math.PI/6));      } else if(castleBounds.contains(hex.xpoints[i], hex.ypoints[i]) && hex.ypoints[i] < c.y) {        hex.xpoints[i] = c.x + cOR;        hex.ypoints[i] = (int)(c.y - cOR*Math.tan(Math.PI/6));      }    }    hex = surroundingHexagons[3];    for(int i = 0; i < hex.npoints; i += 1) {      if(castleBounds.contains(hex.xpoints[i], hex.ypoints[i]) && hex.ypoints[i] > c.y) {        hex.xpoints[i] = c.x - cOR;        hex.ypoints[i] = (int)(c.y + cOR*Math.tan(Math.PI/6));      } else if(castleBounds.contains(hex.xpoints[i], hex.ypoints[i]) && hex.ypoints[i] < c.y) {        hex.xpoints[i] = c.x - cOR;        hex.ypoints[i] = (int)(c.y - cOR*Math.tan(Math.PI/6));      }    }    Point c1 = polygonCenter(surroundingHexagons[1]);    surroundingHexagons[1].xpoints = new int[7];    surroundingHexagons[1].ypoints = new int[7];    surroundingHexagons[1].xpoints[0] = c.x + cOR;    surroundingHexagons[1].ypoints[0] = (int)(c.y + cOR*Math.tan(Math.PI/6));    surroundingHexagons[1].xpoints[1] = c.x + cOR;    surroundingHexagons[1].ypoints[1] = c.y + cOR;    surroundingHexagons[1].xpoints[2] = c.x;    surroundingHexagons[1].ypoints[2] = c.y + cOR;    surroundingHexagons[1].xpoints[3] = c.x;    surroundingHexagons[1].ypoints[3] = (int)(c1.y + hexRad/2);    surroundingHexagons[1].xpoints[4] = c1.x;    surroundingHexagons[1].ypoints[4] = (int)(c1.y + hexRad);    surroundingHexagons[1].xpoints[5] = (int)(c1.x + Math.sqrt(3)/2*hexRad);    surroundingHexagons[1].ypoints[5] = (int)(c1.y + hexRad/2);    surroundingHexagons[1].xpoints[6] = (int)(c1.x + Math.sqrt(3)/2*hexRad);    surroundingHexagons[1].ypoints[6] = (int)(c1.y - hexRad/2);    surroundingHexagons[1].npoints = 7;    surroundingHexagons[2].xpoints = new int[7];    surroundingHexagons[2].ypoints = new int[7];    surroundingHexagons[4].xpoints = new int[7];    surroundingHexagons[4].ypoints = new int[7];    surroundingHexagons[5].xpoints = new int[7];    surroundingHexagons[5].ypoints = new int[7];    surroundingHexagons[2].npoints = 7;    surroundingHexagons[4].npoints = 7;    surroundingHexagons[5].npoints = 7;    for(int i = 0; i < 7; i += 1) {      surroundingHexagons[2].xpoints[i] = c.x + -(surroundingHexagons[1].xpoints[i]-c.x);      surroundingHexagons[2].ypoints[i] = surroundingHexagons[1].ypoints[i];      surroundingHexagons[4].xpoints[i] = surroundingHexagons[2].xpoints[i];      surroundingHexagons[4].ypoints[i] = c.y + -(surroundingHexagons[1].ypoints[i]-c.y);      surroundingHexagons[5].xpoints[i] = surroundingHexagons[1].xpoints[i];      surroundingHexagons[5].ypoints[i] = surroundingHexagons[4].ypoints[i];    }    //create the conections from castle to hexagons    castleConnections[castleIndex][0] = new Vector();    castleConnections[castleIndex][0].add(castles[castleIndex][1]);    castleConnections[castleIndex][0].add(castles[castleIndex][3]);    castleConnections[castleIndex][0].add(surroundingHexagons[0]);    castleConnections[castleIndex][0].add(surroundingHexagons[1]);    castleConnections[castleIndex][1] = new Vector();    castleConnections[castleIndex][1].add(castles[castleIndex][0]);    castleConnections[castleIndex][1].add(castles[castleIndex][2]);    castleConnections[castleIndex][1].add(surroundingHexagons[2]);    castleConnections[castleIndex][1].add(surroundingHexagons[3]);    castleConnections[castleIndex][2] = new Vector();    castleConnections[castleIndex][2].add(castles[castleIndex][1]);    castleConnections[castleIndex][2].add(castles[castleIndex][3]);    castleConnections[castleIndex][2].add(surroundingHexagons[3]);    castleConnections[castleIndex][2].add(surroundingHexagons[4]);    castleConnections[castleIndex][3] = new Vector();    castleConnections[castleIndex][3].add(castles[castleIndex][2]);    castleConnections[castleIndex][3].add(castles[castleIndex][0]);    castleConnections[castleIndex][3].add(surroundingHexagons[5]);    castleConnections[castleIndex][3].add(surroundingHexagons[0]);    //create the connections from hexagons to castle    for(int i = 0; i < 4; i += 1) {      for(int j = 0; j < castleConnections[castleIndex][i].size(); j += 1) {        int hexIndex = countryPolygons.indexOf(castleConnections[castleIndex][i].get(j));        if(hexIndex != -1) ((Vector)connections.get(hexIndex)).add(castles[castleIndex][i]);      }    }  }  //create borders between the countryside continents. each countryside continent  //consists of all hexagons closer to a given castle than any other. borders between  //continents should consist of choke points in the forms of penalty bridges or land  //bridges  private void makeCountrysideBorders() {    //countrySideConnectionType[i][j] =     //   0 - castles i and j are not connected    //   1 - castles i and j are connected by a land bridge    //   2 - castles i and j are connected by a penalty bridge    int[][] countrysideConnectionType = new int[numCastles][numCastles];    //borders[i][j] consists of the countries on the border between i and j    Vector[][] borders = new Vector[numCastles][numCastles];    for(int i = 0; i < numCastles; i += 1) {      for(int j = 0; j < numCastles; j += 1) {        countrysideConnectionType[i][j] = 0; //no connections        borders[i][j] = new Vector();      }    }    //the points at the center of each castle    Point[] castlePoints = new Point[numCastles];    for(int i = 0; i < numCastles; i += 1) {      castlePoints[i] = polygonCenter(castleCenters[i]);    }    //now, for each country, determine if it is on the border between its two    //closest castles. pick connection types for continents that border each other    loop:    for(int i = 0; i < countryPolygons.size(); i += 1) {      Point closestCastle = null;      Point secondClosest = null;      int closestIndex = -1;      int secondClosestIndex = -1;      double closestDist = 10000;      double secondClosestDist = 10000;      for(int j = 0; j < numCastles; j += 1) {        double dist = dist(castlePoints[j], polygonCenter((Polygon)countryPolygons.get(i)));        if(dist < secondClosestDist) {          if(dist < closestDist) {            secondClosest = closestCastle;            secondClosestDist = closestDist;            secondClosestIndex = closestIndex;            closestCastle = castlePoints[j];            closestDist = dist;            closestIndex = j;          } else {            secondClosest = castlePoints[j];            secondClosestDist = dist;            secondClosestIndex = j;          }        }      }      if(secondClosest == null) continue loop;      Point midpoint = midpoint(closestCastle, secondClosest);      double lineAngle = (Math.atan2(closestCastle.y - secondClosest.y ,                            closestCastle.x - secondClosest.x) + Math.PI/2+6*Math.PI)%(2*Math.PI);      Point endpoint1 = new Point((int)(midpoint.x + -1000*Math.cos(lineAngle)),                                  (int)(midpoint.y + -1000*Math.sin(lineAngle)));      Point endpoint2 = new Point((int)(midpoint.x +  1000*Math.cos(lineAngle)),                                  (int)(midpoint.y +  1000*Math.sin(lineAngle)));      Line2D.Double perpBisector = new Line2D.Double(endpoint1, endpoint2);      Rectangle r = dilatePolygon((Polygon)countryPolygons.get(i), 33.0/31).getBounds();      if(!perpBisector.intersects(r)) {        continue loop; //not part of a border      }      int connType = countrysideConnectionType[closestIndex][secondClosestIndex];      if(connType == 0) {        connType = 1+rand.nextInt(2);        countrysideConnectionType[secondClosestIndex][closestIndex] = connType;        countrysideConnectionType[closestIndex][secondClosestIndex] = connType;      }      borders[closestIndex][secondClosestIndex].add((Polygon)countryPolygons.get(i));      borders[secondClosestIndex][closestIndex].add((Polygon)countryPolygons.get(i));    }    //now, for land bridge connections remove all countries on the border except an isthmus    //remove all border countries for penalty bridge connections    for(int i = 0; i < numCastles; i += 1) {      for(int j = i+1; j < numCastles; j += 1) {        if(countrysideConnectionType[i][j] == 1) { //land bridge          //keep is whether we keep or remove a given hexagon:          boolean[] keep = new boolean[borders[i][j].size()];          for(int k = 0; k < keep.length; k += 1) {            keep[k] = false;          }          loop:          for(int k = 0; k < 1; k += 1) {            int bridgeSeed = rand.nextInt(borders[i][j].size());            keep[bridgeSeed] = true;            //don't retain a polygon already removed by another connection:            if(!countryPolygons.contains(borders[i][j].get(bridgeSeed))) {              k -= 1;              continue loop;            }            //keep a hexagon and all those that touch it            Vector conns = (Vector)connections.get(countryPolygons.indexOf(borders[i][j].get(bridgeSeed)));            for(int l = 0; l < conns.size(); l += 1) {              int index =  borders[i][j].indexOf((Polygon)conns.get(l));              if(index != -1) keep[index] = true;            }          }          for(int k = 0; k < borders[i][j].size(); k += 1) {            if(!keep[k]) removeHexagon((Polygon)borders[i][j].get(k));          }        } else if(countrysideConnectionType[i][j] == 2) { //penalty bridge, remove everything          for(int k = 0; k < borders[i][j].size(); k += 1) {            removeHexagon((Polygon)borders[i][j].get(k));          }        }      }    }    //make bridges. the bridge's location is initial the midpoint of the castles it connects    //then we choose the two hexagons a bridge at that point would connect to, and move the     //bridge center to their midpoint. repeat to get a well-placed bridge. then make it    for(int i = 0; i < numCastles; i += 1) {      for(int j = i + 1; j < numCastles; j += 1) {        if(countrysideConnectionType[i][j] == 2) {          Point bridgeCenter = midpoint(castlePoints[i], castlePoints[j]);          int closestToI = -1, closestToJ = -1;          int iDist = 10000;          int jDist = 10000;          for(int iter = 0; iter < 5; iter += 1) {            for(int k = 0; k < countryPolygons.size(); k += 1) {              int closestCastle = closestCastle((Polygon)countryPolygons.get(k));              int bDist = (int)dist(bridgeCenter, polygonCenter((Polygon)countryPolygons.get(k)));              if(closestCastle == i && bDist < iDist) {                iDist = bDist;                closestToI = k;              }              if(closestCastle == j && bDist < jDist) {                jDist = bDist;               closestToJ = k;              }            }            bridgeCenter = midpoint(polygonCenter((Polygon)countryPolygons.get(closestToI)),                                    polygonCenter((Polygon)countryPolygons.get(closestToJ)));          }          makeBridgeBetween((Polygon)countryPolygons.get(closestToI),                            (Polygon)countryPolygons.get(closestToJ));        }      }    }    //remove any isolated hexagons or hexagons in the wrong continent    for(int i = 0; i < countryPolygons.size(); i += 1) {      Vector conns = (Vector)connections.get(i);      boolean hasNeighborInContinent = false;      int iClosestCastle = closestCastle((Polygon)countryPolygons.get(i));      for(int j = 0; j < conns.size(); j += 1) {        if(countryPolygons.contains(conns.get(j)) &&           iClosestCastle == closestCastle((Polygon)conns.get(j))) {          hasNeighborInContinent = true;        }      }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲最新视频在线播放| 久久伊人中文字幕| 亚洲国产精品久久人人爱| 中文字幕色av一区二区三区| 亚洲欧美偷拍三级| 五月天激情综合网| 久久综合色鬼综合色| 欧美丰满美乳xxx高潮www| 一道本成人在线| 久久久亚洲高清| 成人免费看的视频| 成人黄色小视频| 国产欧美一区二区三区网站| 美女视频黄 久久| 日本人妖一区二区| 精品国产免费久久 | 欧美日韩中文字幕一区二区| 国产一区二区在线观看视频| 国产 欧美在线| 亚洲宅男天堂在线观看无病毒| 精品一区二区三区视频在线观看| 日韩欧美综合在线| 国产99久久久国产精品潘金| 久久国产尿小便嘘嘘| 国产精品视频第一区| 国产人成亚洲第一网站在线播放| 日韩一级片网站| 国产很黄免费观看久久| 欧美丰满一区二区免费视频| 性久久久久久久久久久久| 亚洲视频小说图片| 欧美性高清videossexo| 亚洲老司机在线| 夜夜亚洲天天久久| 精品在线观看视频| 国产成人av电影免费在线观看| 国产美女精品人人做人人爽| 久久精品男人天堂av| 亚洲精品少妇30p| 91精品国产综合久久久久久漫画| 国产无人区一区二区三区| 国产精品麻豆一区二区| 国产精品一区二区在线看| 色综合天天做天天爱| 国产精品家庭影院| 久久久亚洲欧洲日产国码αv| 亚洲午夜精品网| 国产美女精品一区二区三区| 国产精品久久免费看| 一区二区三区电影在线播| 99国产麻豆精品| 日本vs亚洲vs韩国一区三区| 日本一区二区三区dvd视频在线| 国产精品丝袜黑色高跟| 天天操天天色综合| 久久久久久99久久久精品网站| 欧美精品一区二区三| 久久精品国产一区二区三| 6080日韩午夜伦伦午夜伦| 成人午夜免费视频| 91麻豆国产香蕉久久精品| 首页欧美精品中文字幕| 国产在线播精品第三| 成人av在线网| 麻豆精品久久久| 久久综合五月天婷婷伊人| 色狠狠av一区二区三区| 中文字幕在线不卡视频| 色婷婷国产精品| 国产一区二区福利视频| 8v天堂国产在线一区二区| 欧美日韩视频一区二区| 免费成人深夜小野草| 五月天久久比比资源色| 国产精品电影一区二区| 精品国产第一区二区三区观看体验 | 91精品国产色综合久久ai换脸| 人人爽香蕉精品| 日本大胆欧美人术艺术动态| 精品一区二区三区免费毛片爱| 激情综合网av| 91视频在线观看免费| 日韩三级av在线播放| 一区二区三区在线免费观看 | 不卡视频免费播放| 日韩视频一区在线观看| 亚洲国产精品一区二区尤物区| 91蝌蚪porny| 欧美国产成人精品| 国产99久久久久| 久久一夜天堂av一区二区三区| 日本午夜一区二区| 69精品人人人人| 日韩主播视频在线| 欧美日韩国产综合草草| 一区二区三区日韩欧美精品| 大陆成人av片| 国产精品区一区二区三区| 国产精品一级二级三级| 精品国精品国产尤物美女| 久久电影网站中文字幕| 欧美xxxx在线观看| 黄页网站大全一区二区| 久久久精品欧美丰满| 精品中文字幕一区二区小辣椒 | 日韩中文字幕1| 91精品国产高清一区二区三区 | 日韩成人一区二区三区在线观看| 欧美亚洲国产bt| 亚洲国产精品欧美一二99| 欧洲另类一二三四区| 亚洲视频一区二区免费在线观看| 91视频91自| 亚洲乱码精品一二三四区日韩在线| 99热在这里有精品免费| 最近日韩中文字幕| 色综合久久综合网欧美综合网| 亚洲精品综合在线| 在线观看av不卡| 有码一区二区三区| 欧美精品在线视频| 美女免费视频一区| 国产日韩欧美综合在线| 99在线视频精品| 亚洲3atv精品一区二区三区| 精品日韩av一区二区| 国产精品99久久久久久宅男| 国产精品丝袜一区| 色999日韩国产欧美一区二区| 日日摸夜夜添夜夜添国产精品| 日韩欧美精品三级| 处破女av一区二区| 一区二区三区在线免费视频| 6080午夜不卡| 国产福利视频一区二区三区| 亚洲免费毛片网站| 欧美精品色综合| 国产成人亚洲综合色影视| 亚洲精品一二三区| 日韩一区二区三区四区| 风流少妇一区二区| 婷婷久久综合九色综合伊人色| 成人午夜碰碰视频| 中文字幕一区日韩精品欧美| 欧美精品久久久久久久多人混战 | 欧美成人精精品一区二区频| 成人免费看的视频| 日日夜夜一区二区| 国产欧美一区二区精品性色| 在线观看网站黄不卡| 韩日精品视频一区| 一区二区久久久久久| 久久久91精品国产一区二区三区| 91久久精品国产91性色tv| 国产一区二区三区日韩| 一二三四社区欧美黄| 国产欧美一区二区三区鸳鸯浴 | 色天天综合久久久久综合片| 国内国产精品久久| 亚洲第一福利视频在线| 国产精品乱人伦一区二区| 欧美绝品在线观看成人午夜影视| 国产成人精品免费一区二区| 日韩精品乱码免费| 亚洲男同1069视频| 欧美激情在线看| 91精品国产色综合久久不卡蜜臀 | 欧美综合色免费| 国产成人精品亚洲日本在线桃色| 偷窥国产亚洲免费视频| 亚洲欧美在线另类| 久久香蕉国产线看观看99| 欧美色爱综合网| 99在线精品观看| 国产精品一区一区| 日本人妖一区二区| 亚洲成人激情自拍| 亚洲美女精品一区| 国产欧美精品一区二区三区四区| 欧美一区二区二区| 欧美性生活影院| 99国产精品久久久久| 国产成人午夜99999| 久久99精品久久久久久动态图| 五月天国产精品| 一区二区三区在线观看国产 | 成人h精品动漫一区二区三区| 另类综合日韩欧美亚洲| 日韩影院免费视频| 亚洲国产色一区| 亚洲国产精品人人做人人爽| 一区二区三区四区不卡在线| 国产精品久久看| 亚洲国产精品精华液2区45| 精品国产青草久久久久福利| 日韩欧美亚洲一区二区| 日韩欧美一级片| 日韩欧美在线123| 91精品国产乱| 欧美成人女星排行榜|