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

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

?? castleinfinity.java

?? good project for programmer,,
?? JAVA
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
  //draw houses and such in the countryside  private void drawCountrysideDecorations() {    //get the images from the Castle Lux SI foreground    BufferedImage house1 = siForeground.getSubimage(305, 190, 40, 40);    BufferedImage house2 = siForeground.getSubimage(775, 193, 35, 35);    BufferedImage house3 = siForeground.getSubimage(790, 228, 35, 35);    BufferedImage house4 = siForeground.getSubimage(65, 391, 40, 40);    BufferedImage house5 = siForeground.getSubimage(420, 200, 52, 40);    BufferedImage[] houses = new BufferedImage[]{house1, house2, house3, house4, house5};    double[] maxRadii = new double[]{15, 21, 21, 15, 12};    boolean[] used = new boolean[countryPolygons.size()];    for(int i = 0; i < used.length; i += 1) used[i] = false;    loop:    for(int i = 0; i < countryPolygons.size()/2; i += 1) {      int index;      do {        index = rand.nextInt(countryPolygons.size());      } while(used[index]);      used[index] = true;      int houseType = rand.nextInt(houses.length);      Point center = polygonCenter((Polygon)countryPolygons.get(index));      double radius = 10 + rand.nextDouble()*(maxRadii[houseType]-10);      double angle = rand.nextDouble()*Math.PI*2;      center.x += (int)(radius*Math.cos(angle));      center.y += (int)(radius*Math.sin(angle));      for(int c = 0; c < numCastles; c += 1) {        if(dist(polygonCenter(castleCenters[c]), center) < Math.sqrt(2)*cOR + 15)          continue loop;      }      BufferedImage house = houses[houseType];      foreG.drawImage(house, center.x-house.getWidth()/2, height - (center.y + house.getWidth()/2), this);    }  }  private static final Point[] siCastlePoints = new Point[]{new Point(260, 100)};  private static final int siCastleWidth = 40;  private static final int siCastleHeight = 40;  //draw the image of a castle at point c  private void drawCastleAt(Point c) {    int i = rand.nextInt(siCastlePoints.length);    backG.setColor(Color.green.darker().darker());    backG.fillRect(c.x - cOR, height - (c.y + cOR), 2*cOR, 2*cOR);    foreG.drawImage(siForeground.getSubimage(siCastlePoints[i].x-siCastleWidth,                    siCastlePoints[i].y-siCastleHeight, 2*siCastleWidth, 2*siCastleHeight), c.x-siCastleWidth, height - (c.y+siCastleHeight), this);  }  //remove a hexagon from the map  private void removeHexagon(Polygon h) {    int index = countryPolygons.indexOf(h);    if(index != -1) {      countryPolygons.remove(index);      connections.remove(index);    }  }  //can a hexagon be the center of a castle? only if it's far enough from the edge  private boolean canBeCastleCenter(int index) {    Point center = polygonCenter((Polygon)countryPolygons.get(index));    if(center.x > hexRad*3 && center.y > hexRad*3 &&       center.x < width-hexRad*3 && center.y < height-hexRad*3) {      return true;    } else {      return false;    }  }  //find the index of the closest castle to a polygon  private int closestCastle(Polygon p) {    int closestCastle = -1;    double closestDist = 100000;    for(int i = 0; i < numCastles; i += 1) {      double dist = dist(polygonCenter(castleCenters[i]), polygonCenter(p));      if(dist < closestDist) {        closestDist = dist;        closestCastle = i;      }    }    return closestCastle;  }  //test if a line intersects any of a polygon's edges  private boolean lineIntersectsPolygon(Line2D.Double l, Polygon p) {    for(int i = 0; i < p.npoints; i += 1) {      Line2D.Double l2 = new Line2D.Double(p.xpoints[i], p.ypoints[i],                               p.xpoints[(i+1)%p.npoints], p.ypoints[(i+1)%p.npoints]);      if(l.intersectsLine(l2)) return true;    }    return false;  }  //draw Polygon p with g, but flip it upside-down first  //theme and xml have different coordinate systems  private void fillPolygon(Graphics g, Polygon p) {    int[] ypoints = new int[p.npoints];    for(int i = 0; i < p.npoints; i += 1) {      ypoints[i] = height - p.ypoints[i];    }    g.fillPolygon(p.xpoints, ypoints, p.npoints);  }       private Point midpoint(Point a, Point b) {    return new Point((a.x + b.x)/2, (a.y + b.y)/2);  }  private static final String[] suffixes = new String[]{"ville", "ton", " town", " city", " village"};  //generate a random name for a hexagon country from our list of players  private String makeHexagonName() {    return names[rand.nextInt(names.length)] + suffixes[rand.nextInt(suffixes.length)];  }  //random castle name  private String makeCastleName() {    return new String(new char[]{Character.toUpperCase(consonants[rand.nextInt(numConsonants)]),                                  vowels[rand.nextInt(numVowels)],                                  consonants[rand.nextInt(numConsonants)],                                  vowels[rand.nextInt(numVowels)],                                  consonants[rand.nextInt(numConsonants)],                                  vowels[rand.nextInt(numVowels)],                                  consonants[rand.nextInt(numConsonants)]}) + " Castle";  }  //random countryside name  private String makeCountrysideName(String castleName) {    String[] types = new String[]{"Lowlands", "Highlands", "Forest", "Countryside", "Plains", "Hills", "Valley"};    return castleName + " " + types[rand.nextInt(types.length)];  }  private String makeWallName(int wall) {    switch(wall) {      case 0:        return "NE Wall";      case 1:        return "NW Wall";      case 2:        return "SW Wall";      case 3:        return "SE Wall";    }    return "Castle Wall";  }  //make a hexagon centered on point p  private Polygon hexagonAround(Point p) {    int[] xpoints = new int[6];    int[] ypoints = new int[6];    for(int i = 0; i < 6; i += 1) {      xpoints[i] = (int)(p.x + (hexRad-1)*Math.cos(Math.PI/6 + i*Math.PI/3));      ypoints[i] = (int)(p.y + (hexRad-1)*Math.sin(Math.PI/6 + i*Math.PI/3));    }    return new Polygon(xpoints, ypoints, 6);  }  //find the center of gravity of a polygon's points  private Point polygonCenter(Polygon p) {    double x = 0;    double y = 0;    for(int i = 0; i < p.npoints; i += 1) {      x += p.xpoints[i];      y += p.ypoints[i];    }    x /= p.npoints;    y /= p.npoints;    return new Point((int)x, (int)y);  }  //draw a line between the polygons with endpoints on their perimeters  //we do this through a binary search for their boundaries  private Line2D.Double drawLineBetween(Polygon a, Polygon b) {    Point ca = polygonCenter(a);    Point cb = polygonCenter(b);    double theta = Math.atan2(ca.y - cb.y, ca.x - cb.x);    double radius = dist(ca, cb);    double movement = radius/2;    for(int i = 0; i < 20; i += 1) {      ca = new Point((int)(cb.x + radius*Math.cos(theta)), (int)(cb.y + radius*Math.sin(theta)));      if(a.contains(ca)) {        radius -= movement;      } else {        radius += movement;      }      movement /= 2;    }    radius += 5; //make sure the line isn't detached    ca = new Point((int)(cb.x + radius*Math.cos(theta)), (int)(cb.y + radius*Math.sin(theta)));    theta += Math.PI;    radius = dist(ca, cb);    movement = radius/2;    for(int i = 0; i < 20; i += 1) {      cb = new Point((int)(ca.x + radius*Math.cos(theta)), (int)(ca.y + radius*Math.sin(theta)));      if(b.contains(cb)) {        radius -= movement;      } else {        radius += movement;      }      movement /= 2;    }    radius += 5; //make sure the line isn't detached    cb = new Point((int)(ca.x + radius*Math.cos(theta)), (int)(ca.y + radius*Math.sin(theta)));    return new Line2D.Double(ca, cb);  }  //write the xml representation of a country polygon  private void writePolygon(Polygon p) {    out.write("    <polygon>");    for(int i = 0; i < p.npoints; i += 1) {      out.write("" + p.xpoints[i] + "," + p.ypoints[i] + " ");    }    out.write("</polygon>\n");  }  //write the xml representation of a country's adjoining list  private void writeConnections(Vector conns) {    out.write("    <adjoining>");    for(int i = 0; i < conns.size()-1; i += 1) {      out.write("" + (Integer)conns.get(i) + ",");    }    if(conns.size() > 0) out.write("" + (Integer)conns.get(conns.size()-1));    out.write("</adjoining>\n");  }  //write the xml representation of a line  private void writeLine(Line2D.Double l) {    out.write("<line><position>" + (int)l.x1 + "," + (int)l.y1 + " " +                                   (int)l.x2 + "," + (int)l.y2 + "</position></line>\n");  }  //dilate p by ratio ratio  private Polygon dilatePolygon(Polygon p, double ratio) {    Point c = polygonCenter(p);    int[] xpoints = new int[p.npoints];    int[] ypoints = new int[p.npoints];    for(int i = 0; i < p.npoints; i += 1) {       xpoints[i] = (int)(c.x + ratio*(p.xpoints[i] - c.x));       ypoints[i] = (int)(c.y + ratio*(p.ypoints[i] - c.y));    }    return new Polygon(xpoints, ypoints, p.npoints);  }  //distance between two points  private double dist(Point a, Point b) {    return Math.sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));  }  //interface function. should be true on release  public boolean canCache() {    return false;  }  public String description() {    return "CastleInfinity is a random map generator that makes maps in the style of Castle Lux SI, complete with a similar theme. Note that the randomly generated themes will only be seen by the host in network games.\n\nCredit for the graphics from Castle Lux SI goes to Mark Bauer.";    }  //user size choices  static final String CHOICE_SMALL = "CastleInfinity - small";  static final String CHOICE_NORMAL = "CastleInfinity - normal";  static final String CHOICE_BIG = "CastleInfinity - big";  public java.util.List getChoices() {    Vector v = new Vector();    v.add(CHOICE_SMALL);    v.add(CHOICE_NORMAL);    v.add(CHOICE_BIG);    return v;  }  //interface function; unused  public String message(String message, Object data) {    return "";  }  public String name() {    return "CastleInfinity";  }  public float version() {    return 1.0f;  }  private void debug(String s) {    System.out.println(":" + s);  }  //list of player names for naming hexagon countries, taken from http://sillysoft.net/lux/rankings/wins/alltime.php on June 14, 2006  String[] names = new String[]{"shopi","Loki","magpie","upeng2005","jOnNiE","Smedz","paranoiarodeo","mercer","obiwan","General K","tfPunx","Punkee.Munkee","MrBuckin the Impaler","Brewster","Jerry T","DR.Zuss","documan","what? oh yeah.","MASSHOLE","Darth Rellek","Mouldy Dog","PJR","'84 Tigers","Dad","JadePathMan","dustin","Gabo","michelle","Alexander_the_Great","futurist","Gryffindor","KingPatrick","shalafarky","bstevens","vargas","Yo Daddy","gary the cheater","shock-n-ya'll","stevedip","Grozoth","Mud","fink","Natya","mood in dhingo","fishflakes","Preacherman","mikey","Zo

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品1区2区3区在线观看| 麻豆一区二区三区| 777色狠狠一区二区三区| 久草精品在线观看| 亚洲麻豆国产自偷在线| 日韩欧美一二三四区| 91丨porny丨户外露出| 久久99热这里只有精品| 亚洲福利视频一区二区| 国产精品每日更新在线播放网址 | 欧美性受xxxx黑人xyx性爽| 久久国产精品第一页| 亚洲影院免费观看| 国产精品久久久久久久久图文区| 欧美一级高清大全免费观看| 91福利在线播放| 成人亚洲一区二区一| 美女免费视频一区| 亚洲一区二区三区爽爽爽爽爽| 国产精品污www在线观看| 欧美白人最猛性xxxxx69交| 日本乱人伦一区| 成人av免费网站| 国产mv日韩mv欧美| 精品午夜一区二区三区在线观看| 婷婷久久综合九色综合绿巨人| 亚洲乱码国产乱码精品精小说| 国产精品久久久久9999吃药| 国产女人水真多18毛片18精品视频| 国产精品免费视频一区| 久久久噜噜噜久久中文字幕色伊伊| 欧美一级生活片| 欧美一级专区免费大片| 欧美精选午夜久久久乱码6080| 在线欧美日韩精品| 欧洲av一区二区嗯嗯嗯啊| 一本久久a久久免费精品不卡| 波波电影院一区二区三区| 国产成人免费视频精品含羞草妖精| 狠狠色狠狠色合久久伊人| 精品一区二区国语对白| 久草在线在线精品观看| 国精产品一区一区三区mba视频 | 国产美女一区二区三区| 国产精一品亚洲二区在线视频| 国产伦精一区二区三区| 国产一区二区三区在线观看免费视频 | 99久久亚洲一区二区三区青草| 国产ts人妖一区二区| 成人高清在线视频| 91色porny在线视频| 欧美午夜视频网站| 欧美精品乱码久久久久久按摩| 欧美日韩国产成人在线免费| 91精品国产综合久久香蕉麻豆| 欧美一级高清片| 国产日韩精品一区| 18欧美乱大交hd1984| 亚洲电影第三页| 日本不卡123| 国产乱人伦偷精品视频不卡| 成人中文字幕在线| 色婷婷综合中文久久一本| 欧美日韩精品一区二区三区四区| 日韩精品中文字幕一区二区三区 | 欧美天堂一区二区三区| 日韩一区二区视频| 国产婷婷色一区二区三区在线| 国产精品人人做人人爽人人添| 亚洲永久精品国产| 精品一区二区三区在线观看国产| 国产91露脸合集magnet| 精品国产乱码久久久久久蜜臀| 国产欧美一区在线| 一区二区三区在线免费观看| 男女激情视频一区| 成人一区二区视频| 欧美日韩卡一卡二| 国产人久久人人人人爽| 亚洲国产一区二区视频| 国产一区福利在线| 欧美综合色免费| 久久色中文字幕| 曰韩精品一区二区| 久久精品国产秦先生| 99久久99久久综合| 精品国产a毛片| 夜夜嗨av一区二区三区中文字幕| 蜜桃精品在线观看| 色综合久久久久综合体桃花网| 欧美一区二区视频免费观看| 国产精品成人免费精品自在线观看| 视频一区在线播放| 波多野结衣亚洲| 欧美不卡123| 亚洲国产裸拍裸体视频在线观看乱了 | 欧美精品在线观看播放| 国产精品情趣视频| 男女男精品视频网| 欧美亚洲尤物久久| 久久久国产精品不卡| 日韩影院在线观看| 91视频一区二区三区| 国产欧美一区视频| 久久电影国产免费久久电影 | 欧美在线一区二区| 国产精品网友自拍| 久久精品国产99久久6| 色婷婷国产精品| 日本一区二区视频在线| 日本韩国精品在线| 国产午夜亚洲精品午夜鲁丝片| 亚洲成av人综合在线观看| 99久久久久免费精品国产| 久久久精品影视| 国产主播一区二区| 日韩一级在线观看| 午夜一区二区三区视频| 一本一道综合狠狠老| 国产精品女人毛片| 国产成人aaa| 久久久久久久久免费| 另类欧美日韩国产在线| 在线不卡欧美精品一区二区三区| 一区二区三区不卡视频在线观看 | 99麻豆久久久国产精品免费优播| 久久久久久久综合狠狠综合| 麻豆精品视频在线观看| 91精品国产黑色紧身裤美女| 亚洲超碰97人人做人人爱| 欧美综合欧美视频| 一区二区三区不卡视频| www.亚洲人| 成人欧美一区二区三区1314| 成人一级片在线观看| 欧美激情一二三区| 不卡一区二区在线| 中文字幕一区二区在线观看| 成人高清伦理免费影院在线观看| 欧美激情一区二区三区蜜桃视频| 国产成人精品影院| 亚洲欧洲日产国码二区| 色综合久久中文字幕| 一片黄亚洲嫩模| 精品视频一区二区不卡| 视频一区视频二区中文字幕| 欧美一区二区免费观在线| 蜜臀av一区二区在线免费观看| 91精品国产91久久综合桃花 | 天天色天天爱天天射综合| 精品视频全国免费看| 日韩激情一区二区| 精品成人私密视频| 国产99久久久精品| 亚洲欧美综合色| 欧美日韩亚洲国产综合| 男人的j进女人的j一区| 精品久久久久久久久久久久包黑料 | 久久国产精品免费| 国产日韩欧美不卡在线| 不卡一二三区首页| 亚洲一区在线观看免费观看电影高清| 欧美日韩黄视频| 麻豆免费看一区二区三区| 国产午夜精品在线观看| 99久久久免费精品国产一区二区| 夜夜爽夜夜爽精品视频| 日韩丝袜情趣美女图片| 国产成a人亚洲精| 亚洲国产综合91精品麻豆 | 夜夜夜精品看看| 日韩免费电影网站| 精品国产91乱码一区二区三区 | 六月丁香综合在线视频| 久久一留热品黄| 97se亚洲国产综合自在线观| 亚洲一级二级三级在线免费观看| 日韩精品一区二区三区三区免费| 大桥未久av一区二区三区中文| 亚洲影院免费观看| 欧美mv日韩mv国产| 91丨九色丨蝌蚪富婆spa| 毛片av中文字幕一区二区| 国产精品免费看片| 91精品国产手机| 成人午夜短视频| 日韩国产一区二| 国产精品免费视频观看| 91精品国产一区二区人妖| 成人av在线一区二区| 免费av成人在线| 中文字幕一区二区三区色视频| 在线电影欧美成精品| 波多野结衣中文字幕一区二区三区| 日韩精品免费专区| 亚洲四区在线观看| 亚洲精品在线一区二区| 欧美午夜电影一区| 不卡的av在线播放| 激情文学综合插|