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

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

?? hextypem.java

?? 用java開發(fā)的一個實施策略游戲源碼 值得學習一下
?? JAVA
字號:
/*
	Netwar
	Copyright (C) 2002  Daniel Grund, Kyle Kakligian, Jason Komutrattananon, & Brian Hibler.
 
	This file is part of Netwar.
 
	Netwar is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
 
	Netwar is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
 
	You should have received a copy of the GNU General Public License
	along with Netwar; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package netwar.mapper;
import netwar.utils.*;
import netwar.utils.vectorgraphics.*;
import java.awt.*;

/** The <CODE>HexType</CODE> class contains every bit of information that is needed to describe a whole set of similar tiles. This structure does not contain specific information such as whether or not a unit is present. (etc.) It does, however, hold methods and fields related to all similar tiles. As an example, a single <CODE>HexType</CODE> could describe all the trees in a given map; this one class would take care of drawing all of the tree tiles as well as making them all impassable.
 * @author Kyle Kakligian
 */
public class HexTypeM {
	private static final int ZOOMS = 6; // the number of different bmp sizes
	/** Contains the common dimensions of all the tiles.
	 */
	public static Point2D Resolutions[];
	//passable. If false, no units may enter.
	private boolean passable;
        static double sqrt3 = Math.sqrt(3);
	static Point3D m_topRight, m_topLeft, m_middleLeft, m_lowerLeft, m_middleRight, m_lowerRight;
	
	/** Holds images for each zoom level. This is done for speed efficiency, as scaling each tile is expensive.
	 */
	Image bmp[] = new Image[ZOOMS];
	/** The color of this tile for the world map viewer.
	 */
	Color color;
	
	/** Creates a new instance of HexType
	 * @param fileName A string containing the file name of the hex's image reletive to the /media/ directory in the JAR file.
	 */
	public HexTypeM(String fileName) {
		init(fileName, Color.black, true);
	}
	
	/** Creates a new instance of HexType
	 * @param fileName A string containing the file name of the hex's image reletive to the /media/ directory in the JAR file.
	 * @param worldMapColor The color of this tile for the world map viewer.
	 */
	public HexTypeM(String fileName, Color worldMapColor) {
		init(fileName, worldMapColor, true);
	}
	//Constructor for a Hextype which may not be passable.
	/** Creates a new instance of HexType
	 * @param fileName A string containing the file name of the hex's image reletive to the /media/ directory in the JAR file.
	 * @param worldMapColor The color of this tile for the world map viewer.
	 * @param Passable true if this tile type can contain a unit, false otherwise.
	 */
	public HexTypeM(String fileName, Color worldMapColor, boolean Passable) {
		init(fileName, worldMapColor, Passable);
	}
	//Istaran added boolean Passable to set passable
	private void init(String f, Color c, boolean Passable) {
		if(m_lowerLeft == null) {
			m_middleRight = new Point3D(Trig.cos(0) * 20 / sqrt3, Trig.sin(0) * 20 / sqrt3, 0);
			m_topRight = new Point3D(Trig.cos(60) * 20 / sqrt3, Trig.sin(60) * 20 / sqrt3, 0);
			m_topLeft = new Point3D(Trig.cos(120) * 20 / sqrt3, Trig.sin(120) * 20 / sqrt3, 0);
			m_middleLeft = new Point3D(Trig.cos(180) * 20 / sqrt3, Trig.sin(180) * 20 / sqrt3, 0);
			m_lowerLeft = new Point3D(Trig.cos(240) * 20 / sqrt3, Trig.sin(240) * 20 / sqrt3, 0);
			m_lowerRight = new Point3D(Trig.cos(300) * 20 / sqrt3, Trig.sin(300) * 20 / sqrt3, 0);
		}
		passable = Passable;
		bmp[0] = LoadImage.LoadWaitForImage(f);
		Assert.notNull(bmp[0], "Image loading error in HexType. (bad tile filename?)");
		color = c;
		makeRes();
	}
	private void makeRes() {
		if(Resolutions == null ) {
			Resolutions = new Point2D[ZOOMS];
			Resolutions[0] = new Point2D(bmp[0].getWidth(null),bmp[0].getHeight(null));
			for(int t = 1; t<ZOOMS; t++)
				Resolutions[t] = new Point2D(.5f * Resolutions[t-1].x,.5f * Resolutions[t-1].y);
		}
		// create a compatible image for this monitor:
		GraphicsConfiguration gconfig = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
		
		for(int t = 1; t<ZOOMS; t++) {
			Assert.notFalse(Resolutions[t].x == .5f * Resolutions[t-1].x, "At least one tile is of different dimensions than the others.");
			Assert.notFalse(Resolutions[t].y == .5f * Resolutions[t-1].y, "At least one tile is of different dimensions than the others.");
			
			// create the new bmp, make it transparent (so that the copied transparency still works
			bmp[t] = gconfig.createCompatibleImage(Resolutions[t].getIntx(),Resolutions[t].getInty(),Transparency.BITMASK);
			Graphics2D g2 = (Graphics2D)(bmp[t].getGraphics());
			
			// copy the image and scale it down
			g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);  // the nearest neighbor method is a must or no transparency. Why the hell don't the others scale the alpha?
			g2.drawImage(bmp[0],0,0,Resolutions[t].getIntx(),Resolutions[t].getInty(),HexViewerM.getHexViewer());
		}
	}
	/** Draws the HexType onto the backgound layer.
	 * @param v What to draw the tile on.
	 * @param pt Where to draw the tile. (in game space)
	 */
        private int x[] = new int[6], y[] = new int[6];
        private Point3D temp2 = new Point3D();
	public void draw(Graphics2D g, Point3D p3) {
            HexViewerM v = HexViewerM.getHexViewer();
            if(v.drawpass || v.drawcolor) {
                if(v.drawpass && passable) v.setColor(Color.green);
                else if(v.drawpass) v.setColor(Color.red);
                else v.setColor(color);
                
		Point2D temp1;
                
                temp2.set(p3);
	        temp1 = v.getTransform().getPoint2D(temp2.doSum(m_topRight));
		x[0] = temp1.getIntx();y[0] = temp1.getInty();
                temp2.set(p3);
	        temp1 = v.getTransform().getPoint2D(temp2.doSum(m_topLeft));
		x[1] = temp1.getIntx();y[1] = temp1.getInty();
                temp2.set(p3);
	        temp1 = v.getTransform().getPoint2D(temp2.doSum(m_middleLeft));
		x[2] = temp1.getIntx();y[2] = temp1.getInty();
                temp2.set(p3);
	        temp1 = v.getTransform().getPoint2D(temp2.doSum(m_lowerLeft));
		x[3] = temp1.getIntx();y[3] = temp1.getInty();
                temp2.set(p3);
	        temp1 = v.getTransform().getPoint2D(temp2.doSum(m_lowerRight));
		x[4] = temp1.getIntx();y[4] = temp1.getInty();
                temp2.set(p3);
	        temp1 = v.getTransform().getPoint2D(temp2.doSum(m_middleRight));
		x[5] = temp1.getIntx();y[5] = temp1.getInty();
        
		g.fillPolygon(x,y,6);
            } else {
		Point2D p2 = v.getTransform().getPoint2D(p3);
		int x = p2.getIntx();
		int y = p2.getInty();
		x -= bmp[MouseParserM.maxZoom-MouseParserM.getZoomLevel()].getWidth(null) / 2;
		y -= bmp[MouseParserM.maxZoom-MouseParserM.getZoomLevel()].getHeight(null) / 2;
		g.drawImage(bmp[MouseParserM.maxZoom-MouseParserM.getZoomLevel()], x, y, null);
            }
            if(v.drawguilds){
                    v.setColor(Color.yellow);
                    v.drawLine(p3.getSum(m_topRight), p3.getSum(m_topLeft));
                    v.drawLine(p3.getSum(m_topLeft), p3.getSum(m_middleLeft));
                    v.drawLine(p3.getSum(m_middleLeft), p3.getSum(m_lowerLeft));
                    v.drawLine(p3.getSum(m_lowerLeft), p3.getSum(m_lowerRight));
                    v.drawLine(p3.getSum(m_lowerRight), p3.getSum(m_middleRight));
                    v.drawLine(p3.getSum(m_middleRight), p3.getSum(m_topRight));
            }
	}

        /** Gets the color for the world map.
	 * @return Color for the world map.
	 */
	public Color getColor() {
		return color;
	}
	//Returns passable boolean
	/** Gets whether or not the tile is passable.
	 * @return true if passable.
	 */
	public boolean getPassable() {
		return passable;
	}
	
	//Returns default status for Hex with this hextype. Currently only affected by passability.
	/** Returns default status for Hex with this <CODE>HexType</CODE>. Currently only affected by passablility.
	 * @return The flag variable from <CODE>Hex</CODE>.
	 */
	public int getDefaultStatus() {
		if(passable)
			return 0;
		return 3;
	}
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲另类激情小说| 欧美中文字幕一区二区三区亚洲| 久久综合色鬼综合色| 国产盗摄精品一区二区三区在线| 国产精品久久久久久久久果冻传媒| 91同城在线观看| 日韩国产欧美三级| 欧美韩日一区二区三区四区| 欧洲色大大久久| 一区二区三区日本| 精品理论电影在线| 欧美日韩你懂得| 一本大道久久a久久综合| 国产一区二区福利| 日av在线不卡| 亚洲成av人片在线观看无码| 18成人在线视频| 国产午夜精品在线观看| 欧美一区二区人人喊爽| 在线观看亚洲一区| 91视频.com| av亚洲精华国产精华精| 国产精品99久久久久久有的能看 | 中文字幕一区二区不卡| 精品国产一二三| 欧美一区二区三区视频免费| 在线观看亚洲专区| 一本色道亚洲精品aⅴ| 成人久久视频在线观看| 国产成人日日夜夜| 国产专区欧美精品| 国产一区二区在线观看免费| 久久不见久久见中文字幕免费| 亚洲成年人网站在线观看| 夜夜精品浪潮av一区二区三区| 亚洲视频一区在线观看| 亚洲欧美自拍偷拍色图| 1000部国产精品成人观看| 亚洲欧洲日产国产综合网| 中文字幕精品三区| 国产精品久久久爽爽爽麻豆色哟哟 | 日韩欧美第一区| 日韩视频一区二区在线观看| 91精品国产日韩91久久久久久| 欧美日韩国产高清一区二区三区 | 久久精品视频免费观看| 久久日韩粉嫩一区二区三区| 亚洲精品在线电影| 国产午夜亚洲精品理论片色戒 | 伊人一区二区三区| 亚洲国产视频网站| 婷婷六月综合亚洲| 久久国产婷婷国产香蕉| 国产裸体歌舞团一区二区| 国产精品亚洲视频| 99久久精品免费看国产| 色婷婷激情久久| 欧美美女直播网站| www久久精品| 中文字幕在线观看一区| 一区二区三区.www| 美女视频一区在线观看| 国产麻豆精品视频| 国产午夜精品一区二区三区嫩草 | 51午夜精品国产| 欧美videossexotv100| 国产网站一区二区三区| 中文字幕日韩一区二区| 午夜视频在线观看一区二区三区| 日日夜夜免费精品视频| 乱中年女人伦av一区二区| 制服.丝袜.亚洲.中文.综合| 26uuu国产在线精品一区二区| 丁香六月久久综合狠狠色| 91啪亚洲精品| 欧美在线观看一区| 日韩精品一区二区三区四区| 欧美国产日产图区| 亚洲人成影院在线观看| 日精品一区二区三区| 国产精品一区二区三区乱码| 色综合久久综合网97色综合| 欧美这里有精品| 精品少妇一区二区三区视频免付费 | 国产精品成人一区二区三区夜夜夜| 一区二区三区小说| 久久99久久99小草精品免视看| 床上的激情91.| 欧美丰满少妇xxxbbb| 国产精品午夜久久| 日韩精品午夜视频| 99久久免费精品| 精品国免费一区二区三区| 日韩毛片精品高清免费| 久久精品国产久精国产爱| 91亚洲精品久久久蜜桃| 亚洲精品一区二区三区四区高清| 亚洲日本护士毛茸茸| 久草这里只有精品视频| 欧美一区二区三区公司| 欧美国产成人在线| 婷婷国产v国产偷v亚洲高清| 不卡一区在线观看| 欧美在线观看18| 国产精品免费久久| 精品一区二区三区免费| 欧美日韩在线电影| 中文字幕一区二区三区不卡 | 亚洲精品乱码久久久久久| 国产一区免费电影| 制服丝袜亚洲精品中文字幕| 亚洲精品va在线观看| 国产尤物一区二区| 日韩三级在线观看| 午夜日韩在线观看| 91国偷自产一区二区三区成为亚洲经典| 久久久精品国产免费观看同学| 日韩国产欧美在线播放| 欧美日韩精品二区第二页| 亚洲人精品一区| av网站一区二区三区| 国产亚洲午夜高清国产拍精品| 热久久免费视频| 欧美在线|欧美| 亚洲精品欧美二区三区中文字幕| 成人动漫一区二区| 国产欧美一区二区精品性| 精品系列免费在线观看| 日韩欧美国产一区二区在线播放| 天天av天天翘天天综合网| 在线观看日韩电影| 亚洲综合色自拍一区| 91麻豆swag| 一区二区三区在线播放| 91久久精品网| 亚洲一区二区三区四区在线观看 | 亚洲免费av观看| 91年精品国产| 一区二区三区国产豹纹内裤在线 | 成人手机在线视频| 日本一区二区三级电影在线观看 | 久久亚洲综合av| 国产精品自在欧美一区| 亚洲国产高清aⅴ视频| 成人av动漫网站| 亚洲欧美一区二区在线观看| av激情综合网| 亚洲男人的天堂在线观看| 色女孩综合影院| 亚洲成av人在线观看| 69堂成人精品免费视频| 久久精品国产99久久6| 久久精品一区八戒影视| 成人激情免费电影网址| 亚洲欧美日韩国产手机在线| 在线视频中文字幕一区二区| 天天爽夜夜爽夜夜爽精品视频| 91精选在线观看| 国产一区二区精品久久91| 国产精品美女久久久久aⅴ| 国产三级精品三级在线专区| 国产成人啪免费观看软件| 亚洲日本青草视频在线怡红院| 欧美唯美清纯偷拍| 青青草97国产精品免费观看无弹窗版 | 天天操天天干天天综合网| 日韩美女一区二区三区四区| 国产传媒一区在线| 一区二区三区.www| 91精品国产综合久久香蕉的特点| 国产麻豆一精品一av一免费| 国产精品国产精品国产专区不蜜 | 欧美在线看片a免费观看| 蜜桃av一区二区三区| 国产精品丝袜黑色高跟| 欧美视频在线观看一区二区| 久久成人免费网| 中文字幕中文字幕在线一区 | 国产制服丝袜一区| 亚洲女与黑人做爰| 欧美一区二区精品| 成人黄色一级视频| 午夜激情一区二区三区| 国产欧美日韩在线| 欧美日韩国产美| 成人av网站免费观看| 日韩中文字幕亚洲一区二区va在线| 久久精品视频在线免费观看| 欧美性猛片xxxx免费看久爱| 国产精品18久久久久久vr| 亚洲一卡二卡三卡四卡| 国产亚洲欧美日韩日本| 欧美精选午夜久久久乱码6080| 国产xxx精品视频大全| 天天影视色香欲综合网老头| 国产精品美女久久久久久久久久久 | 一区二区三区在线观看欧美| 2021久久国产精品不只是精品| 在线观看区一区二| 成人涩涩免费视频|