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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? castleinfinity.java

?? good project for programmer,,
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
////////////////////////CastleInfinity Lux Map Generator//Generates maps for Lux in the style of Castle Lux SI//Greg McGlynn//////////////////////package org.mcglynns.lux;import com.sillysoft.lux.*;import java.util.*;import java.io.*;import java.awt.*;import java.awt.geom.*;import java.awt.image.*;import javax.imageio.*;public class CastleInfinity implements LuxMapGenerator, ImageObserver {  //used in making names  static char[] consonants = new char[]{'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm',                                        'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z'};  static char[] vowels = new char[]{'a', 'e', 'i', 'o', 'u'};  static int numConsonants = consonants.length;  static int numVowels = vowels.length;  Random rand;  int width, height;  //how big the hexagons are:  double hexRad = 32;  Vector countryPolygons;  Vector connections;  Polygon[][] castles;  Vector[][] castleConnections;  Polygon[] castleCenters;  Vector bridgePolygons;  Vector bridgeConnections;  Vector allPolygons;  int numCastles;  String[] castleNames;  String[] countrysideNames;  String choice;  int seed;  MapLoader m;  PrintWriter out;  //theme:  BufferedImage background;  BufferedImage foreground;  Graphics2D backG, foreG;  BufferedImage siForeground = null;  //get the foreground from Castle Lux SI, from which we get building images  private void loadSIForeground() {    try {      File support = new File(m.getMapGeneratorPath()).getParentFile();      String siForegroundPath = support.getPath() + File.separator + "Themes" + File.separator +                                "Castle Lux SI" + File.separator + "overground.png";      siForeground = ImageIO.read(new File(siForegroundPath));    } catch(Exception e) {      e.printStackTrace();    }  }  //Lux calls this when it needs a map, write out the xml and theme for a new map  public boolean generate(PrintWriter pw, String theChoice, int theSeed, MapLoader loader) {    m = loader;    out = pw;    choice = theChoice;    seed = theSeed;    if(siForeground == null) {      loadSIForeground();    }    rand = new Random(seed);    countryPolygons = new Vector();;    connections = new Vector();    bridgePolygons = new Vector();    bridgeConnections = new Vector();    allPolygons = new Vector();    if(choice == CHOICE_SMALL) {      width = 591;      height = 485;      numCastles = 4;    } else if(choice == CHOICE_NORMAL) {      width = 785;      height = 625;      numCastles = 6;    } else if(choice == CHOICE_BIG) {      width = 1062;      height = 765;      numCastles = 10;    }    castles = new Polygon[numCastles][4];    castleConnections = new Vector[numCastles][4];    castleNames = new String[numCastles];    countrysideNames = new String[numCastles];    //get new theme images    background = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);    foreground = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);    backG = (Graphics2D)background.getGraphics();    foreG = (Graphics2D)foreground.getGraphics();    backG.setRenderingHint(RenderingHints.KEY_ANTIALIASING,  RenderingHints.VALUE_ANTIALIAS_ON);    foreG.setRenderingHint(RenderingHints.KEY_ANTIALIASING,  RenderingHints.VALUE_ANTIALIAS_ON);    backG.setColor(new Color(0, 0, 173));    backG.fillRect(0, 0, width, height);    //create a map-spanning grid of hexagons    makeHexagonalGrid();    //chocse hexagons for castle locations    pickCastleCenters();    //name and create each castle    for(int i = 0; i < numCastles; i += 1) {      castleNames[i] = makeCastleName();      countrysideNames[i] = makeCountrysideName(castleNames[i].substring(0, castleNames[i].length() - 7));      makeCastleAround(castleCenters[i], i);    }    //make borders between countryside continents    makeCountrysideBorders();    //bring all polygons into one vector so we know ids.    allPolygons = new Vector();    for(int i = 0; i < countryPolygons.size(); i += 1) {      allPolygons.add(countryPolygons.get(i));    }    for(int i = 0; i < numCastles; i += 1) {      for(int j = 0; j < 4; j += 1) {        allPolygons.add(castles[i][j]);      }    }    for(int i = 0; i < bridgePolygons.size(); i += 1) {      allPolygons.add(bridgePolygons.get(i));    }    //now we have all the data we need to write the xml file    //write the header...    out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +              "<luxboard>\n" +              "<version>1.0</version>\n" +              "<width>" + width + "</width>\n" +              "<height>" + height + "</height>\n" +              "<theme>" + choice+seed + "</theme>\n" +              "<author>CastleInfinity Generator (by Greg McGlynn)</author>\n" +              "<email>greg@mcglynns.org</email>\n" +              "<webpage>www.sillysoft.net</webpage>\n" +              "<title>" + choice + " #" + seed + "</title>\n" +              "<description>This map was made by the CastleInfinity LuxMapGenerator. Type: " + choice + "seed: " + seed + "</description>\n");    writeHexagons(); //the countryside    writeCastles(); //the castles    writeBridges(); //the bridges    out.write("</luxboard>"); //done the xml    out.flush();    //create and write out the theme    doTheme();    return true;  }  //make a grid of hexagons that spans the map. the grid needs to be flush with the sides of the map  private void makeHexagonalGrid() {    //make the hexagons...    for(double x = hexRad; x <= width-hexRad; x += Math.sqrt(3)*hexRad) {      for(double y = hexRad-hexRad/3; y <= height-hexRad+hexRad/3; y += hexRad*3) {        countryPolygons.add(hexagonAround(new Point((int)x, (int)y)));      }    }    for(double x = hexRad+Math.sqrt(3)/2*hexRad; x <= width-hexRad; x += Math.sqrt(3)*hexRad) {      for(double y = 5*hexRad/2-hexRad/3; y <= height-hexRad+hexRad/3; y += hexRad*3) {        countryPolygons.add(hexagonAround(new Point((int)x, (int)y)));      }    }    //connect the ones that touch    for(int i = 0; i < countryPolygons.size(); i += 1) {      connections.add(new Vector());      for(int j = 0; j < countryPolygons.size(); j += 1) {        if(i != j && dist(polygonCenter((Polygon)countryPolygons.get(i)),                          polygonCenter((Polygon)countryPolygons.get(j))) < hexRad*1.9) {          ((Vector)connections.get(i)).add((Polygon)countryPolygons.get(j));        }      }    }    //make hexagons flush with sides of map    for(int h = 0; h < countryPolygons.size(); h += 1) {      Polygon p = (Polygon)countryPolygons.get(h);      Point center = polygonCenter(p);      if(center.x > hexRad*Math.sqrt(3)*2/3 && center.x < hexRad*Math.sqrt(3)*4/3) { //left        p.xpoints = new int[8];        p.ypoints = new int[8];        p.npoints = 8;        for(int i = 0; i < 3; i += 1) {          p.xpoints[i] = center.x + (int)((hexRad-1)*Math.cos(Math.PI/6 + i*Math.PI/3));          p.ypoints[i] = center.y + (int)((hexRad-1)*Math.sin(Math.PI/6 + i*Math.PI/3));        }        p.xpoints[3] = 5;        p.ypoints[3] = p.ypoints[1];        for(int i = 3; i < 6; i += 1) {          p.xpoints[i+2] = center.x + (int)((hexRad-1)*Math.cos(Math.PI/6 + i*Math.PI/3));          p.ypoints[i+2] = center.y + (int)((hexRad-1)*Math.sin(Math.PI/6 + i*Math.PI/3));        }        p.xpoints[4] = 5;        p.ypoints[4] = p.ypoints[6];      }      if(center.x > width - (hexRad*Math.sqrt(3)*4/3) && center.x < width - (hexRad*Math.sqrt(3)*2/3)) { //right        p.xpoints = new int[8];        p.ypoints = new int[8];        p.npoints = 8;        for(int i = 0; i < 6; i += 1) {          p.xpoints[i] = center.x + (int)((hexRad-1)*Math.cos(Math.PI/6 + i*Math.PI/3));          p.ypoints[i] = center.y + (int)((hexRad-1)*Math.sin(Math.PI/6 + i*Math.PI/3));        }        p.xpoints[6] = width-7;        p.ypoints[6] = p.ypoints[4];        p.xpoints[7] = width-7;        p.ypoints[7] = p.ypoints[1];      }      if(center.y < hexRad*1.5) { //bottom        for(int j = 0; j < p.npoints; j += 1) {           if(p.ypoints[j] < center.y) {             p.ypoints[j] = 0;           }        }      }      if(center.y > height - hexRad*1.5) { //top        for(int j = 0; j < p.npoints; j += 1) {          if(p.ypoints[j] > center.y) {            p.ypoints[j]  = height;          }        }      }    }  }  //pick <numCastles> hexagons to be the centers of castles.   //castles must be a certain distance from the side of the map and from each other  private void pickCastleCenters() {    Polygon ret[] = new Polygon[numCastles];    loop1:    while(true) {      loop2:      for(int i = 0; i < numCastles; i += 1) {        loop3:        for(int j = 0; j < 15; j += 1) {          int index;          while(!canBeCastleCenter(index = rand.nextInt(countryPolygons.size())));          ret[i] = (Polygon)countryPolygons.get(index);          for(int k = 0; k < i; k += 1) {            if(dist(polygonCenter(ret[i]), polygonCenter(ret[k])) < 240) {              continue loop3;            }          }          continue loop2;        }        continue loop1;      }      break;    }    for(int i = 0; i < numCastles; i += 1) {      removeHexagon(ret[i]);    }    castleCenters = ret;  }  static final int cOR = 45; //castleOutRadius  static final int cIR = 30; //castleInRadius  static final double[] castleAngles = new double[]{0, Math.PI/4, Math.PI/2, Math.PI/2, Math.PI/4, 0};  static final double[] castleRadii = new double[]{cOR-2, Math.sqrt(2)*(cOR-2), cOR-2, cIR, Math.sqrt(2)*cIR, cIR};  //make the polygons and connections of a castle centered on Polygon p  private void makeCastleAround(Polygon p, int castleIndex) {    Point c = polygonCenter(p);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合色丁香婷婷六月图片| 国产精品国产三级国产普通话蜜臀 | 国产精品12区| 精东粉嫩av免费一区二区三区| 国产一区二区三区电影在线观看 | 国产嫩草影院久久久久| av一区二区三区黑人| 亚洲地区一二三色| www久久久久| 91丨porny丨中文| 久久奇米777| 色婷婷综合久色| 天天av天天翘天天综合网| 99国产精品久久久久| 天天综合日日夜夜精品| 2014亚洲片线观看视频免费| 日本伦理一区二区| 国产精品综合久久| 美女视频黄久久| 亚洲乱码中文字幕| 久久亚洲精品小早川怜子| 在线观看日韩一区| 激情综合网天天干| 夜夜精品视频一区二区| 中文字幕第一区综合| 欧美一区二区在线观看| 欧美在线观看视频一区二区| 丁香六月久久综合狠狠色| 日韩精品一二三| 天堂影院一区二区| 一区二区三区高清| 亚洲第一成年网| 亚洲午夜久久久久中文字幕久| 1区2区3区欧美| 国产精品毛片a∨一区二区三区| 久久久美女毛片| 国产目拍亚洲精品99久久精品| 日韩欧美国产电影| 精品久久国产字幕高潮| 欧美一区二区三区精品| 精品欧美久久久| 综合久久久久久| 亚洲电影第三页| 国产最新精品免费| av一区二区三区四区| 欧美日本韩国一区二区三区视频| 91精品欧美综合在线观看最新| 欧美一级理论片| 中文字幕一区二区三区蜜月| 一区二区高清在线| 久久精品国产精品青草| 国产一区二区三区美女| 色综合天天性综合| 精品国产露脸精彩对白 | 日韩午夜电影在线观看| 久久女同精品一区二区| 国产精品久久久久久久蜜臀| 国产精品三级视频| 午夜一区二区三区视频| 成人午夜视频在线观看| 99久久99久久精品免费看蜜桃| 欧美天天综合网| 国产精品久久毛片av大全日韩| 亚洲va中文字幕| 在线欧美小视频| 国产精品免费看片| 国产精品亚洲第一| 日韩免费看的电影| 蜜臀av在线播放一区二区三区| 欧美三级日本三级少妇99| 国产精品国产三级国产有无不卡| 久久久国际精品| 蜜桃av一区二区| 成人综合婷婷国产精品久久蜜臀 | 国产成人超碰人人澡人人澡| 一本久道中文字幕精品亚洲嫩| 精品久久久久久久久久久久久久久久久| 国产精品免费人成网站| 国产在线精品视频| 久久先锋资源网| 激情欧美一区二区三区在线观看| 7799精品视频| 亚洲激情校园春色| 欧美久久久久久蜜桃| 亚洲免费观看高清| 欧美猛男gaygay网站| 日本视频中文字幕一区二区三区 | 91精品国产欧美日韩| 久久国产精品无码网站| 久久综合狠狠综合久久综合88 | 精品一区二区综合| 国产亚洲人成网站| 91蜜桃婷婷狠狠久久综合9色| 亚洲精品乱码久久久久久黑人 | 国产成人精品亚洲777人妖| 国产精品三级视频| 欧美日韩国产一级二级| 韩国成人精品a∨在线观看| 1000部国产精品成人观看| 欧美三级视频在线播放| 国产一区二区不卡| 一区二区三区四区中文字幕| 精品久久久影院| 欧美日韩日日骚| 色婷婷久久综合| 成人黄色777网| 国产成人精品影视| 韩国三级电影一区二区| 亚洲国产成人av好男人在线观看| 国产午夜精品一区二区三区嫩草 | 91蜜桃在线观看| 国产伦精品一区二区三区免费迷| 亚洲少妇屁股交4| 国产精品二区一区二区aⅴ污介绍| 欧美成人精品福利| 欧美高清www午色夜在线视频| 欧美亚洲一区二区在线观看| 白白色 亚洲乱淫| 91色在线porny| 99精品视频在线观看| 99久久免费精品| 色狠狠av一区二区三区| 在线日韩av片| 欧美精品在线观看一区二区| 欧美色综合网站| 欧洲视频一区二区| 日日摸夜夜添夜夜添亚洲女人| 久久久久久亚洲综合| 欧美一区在线视频| 2020国产精品自拍| 亚洲精品国久久99热| 五月天国产精品| 国产精品资源在线观看| 成人av电影在线| 91麻豆精品国产自产在线观看一区| 91麻豆精品91久久久久同性| 精品久久久久香蕉网| 亚洲视频狠狠干| 精品一区二区影视| av一区二区三区黑人| 日韩无一区二区| 亚洲在线一区二区三区| 国产一区不卡视频| 91在线云播放| 日韩三区在线观看| 亚洲免费观看高清| 成人福利视频网站| 欧美视频三区在线播放| 欧美国产97人人爽人人喊| 亚洲国产成人av网| 成人av电影在线观看| 久久久精品免费网站| 日本v片在线高清不卡在线观看| 99精品国产一区二区三区不卡| 91精品国产欧美日韩| 亚洲在线视频网站| 色综合天天综合网国产成人综合天| 欧美三级一区二区| 午夜精品成人在线视频| 欧美午夜视频网站| 亚洲成av人片一区二区梦乃| 欧美午夜电影在线播放| 一区二区国产盗摄色噜噜| 欧美性极品少妇| 五月激情综合婷婷| 日韩精品一区二区三区四区视频| 日本亚洲最大的色成网站www| 欧美男男青年gay1069videost| 日日夜夜免费精品| 日韩无一区二区| 成人高清免费在线播放| 一区二区欧美精品| 777久久久精品| 丁香婷婷综合激情五月色| 午夜在线电影亚洲一区| 6080日韩午夜伦伦午夜伦| 精品亚洲aⅴ乱码一区二区三区| 国产色综合久久| 91福利资源站| 国产99久久久久| 天堂成人国产精品一区| 久久综合精品国产一区二区三区| 色婷婷激情综合| 粉嫩aⅴ一区二区三区四区五区 | 在线观看欧美精品| 成人ar影院免费观看视频| 日韩黄色一级片| 一区二区成人在线| 国产精品免费人成网站| 欧美mv日韩mv| 欧美精品久久99| 欧美少妇性性性| 色婷婷国产精品| 91丨porny丨蝌蚪视频| 国产一区二区三区久久久 | 久久精品视频免费观看| 日韩限制级电影在线观看| 欧美日韩午夜精品| 欧美在线观看一区二区| 色999日韩国产欧美一区二区|