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

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

?? gameobject.java

?? 用java開發的一個實施策略游戲源碼 值得學習一下
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
			if(go.myID > ID)
				return null; //It isn't in the list (trust me ;)
			GameObjects.goNext();
		}
		return null; //ID is higher than highest ID.
	}
	
	/** GameObject scanner! Finds the nearest living enemy. If none is within weapon range, return null
	 * Will ignore destroyable neutrals (i.e. breakable obstacles like trees)
	 * @return The nearest living enemy GameObject, or null
	 */
	protected GameObject scan() {
		SelfSortingMutualDistanceSquared SSMDS = firstSSMDS;
		GameObject go;
		while(true) {
			if(SSMDS == null)
				return null;
			if(SSMDS.getDistanceSquared() > scanRangeSquared())
				return null;
			go = SSMDS.getOther(this);
			if(validTarget(go))
				return go;
			SSMDS = SSMDS.getNext(this);
		}
	}
	/** Target validation. If a target meets this criteria it can be acquired by scan().
	 * This had to be separated so Units with non-standard functions (healing, stun)
	 * can override the normal target acquisition rules.
	 */
	protected boolean validTarget(GameObject go) {
		return (go.myPlayer != null && go.myPlayer != myPlayer && go.damageable());
	}
	
	/** Accessor for ID.
	 * @return This GameObject's unique ID number.
	 */
	public int getID() {
		return myID;
	}
	
	/** Accessor for Player
	 * @return This GameObject's Player (should be null for neutrals)
	 */
	public Player getPlayer() {
		return myPlayer;
	}
	
	/** Accessor for vr[0].
	 * @return The location of the ground-center of the GameObject, in game-space.
	 */
	public Point3D locate() {
		return vr[0];
	}
	
	/** Clear the current long-term goal.*/
	public abstract void setGoal();
	/** Set the current long-term goal to a location, at hex coordinate (gx, gy).
	 * @param gx The x coordinate of the goal, in hex coords.
	 * @param gy The y coordinate of the goal, in hex coords.
	 */
	public abstract void setGoal(int gx, int gy);
	/** Set the current long-term goal to a GameObject.
	 * @param u The GameObject which is the goal.
	 */
	public abstract void setGoal(GameObject u);
	
	/** Called by the game cycle update system to cause all GameObjects to
	 * perform one time-step of animations and decision making.
	 * This calls update() on each GameObject in the GameObjects Vector.
	 */
	public static void updateAll() {
		GameObjects.goFirst();
		while(GameObjects.isInList()) {
			((GameObject)GameObjects.get()).update();
			GameObjects.goNext();
		}
	}
	
	//The remaining methods are intended to be over-rided by sub-classes of GameObject.
	/** Perform operations for this time step.
	 * Specifically, perform the Point3D transforms for any/all animations,
	 * fire at an enemy if possible, and do any required decision making.
	 */
	protected abstract void update();
	
	/** Returns the number of frames of animation for the creation sequence.
	 * @return The number of frames needed to animate creation.
	 */
	protected abstract int framesToMake();
	/** Returns the number of frames of animation for the death sequence.
	 * @return The number of frames needed to animate death.
	 */
	protected abstract int framesToDie();
	
	/** Initialize the Point3Ds used for this Base.
	 * These are the location of the ground-center of the Base in game-space, and
	 * the relative locations of the triangle/line vertices relative to that point.
	 */
	protected void createVectors() {
		vr = new Point3D[1];
		vr[0] = Hex.getMapPoint(x,y);
	}
	/** Draw this GameObject onto GameViewer v, by using v's drawing methods.
	 * @param v The GameViewer which will display this GameObject.
	 * @see netwar.gui.HexViewer
	 */
	public abstract void draw(GameViewer v);
	/** Perform the data changes for one frame of animation while being made.*/
	/** Requests that the GraphicThing(s) used by this object be added to GameViewer v.
	 * @param v The GameViewer which will be displaying the object.
	 */
	public void addTo(GameViewer v) {}
	protected abstract void animateMake();
	/** Perform the data changes for one frame of animation while dying.*/
	protected abstract void animateDie();
	/** Return the height of this GameObject for selection box and explosion hit calculations.
	 * @return The height of the GameObject in game-space units.
	 */
	public abstract float getHeight();
	/** Return the width of this GameObject for selection box and explosion hit calculations.
	 * @return The width of the GameObject in game-space units.
	 */
	public abstract float getWidth();
	/** Return the square of the maximum weapon range of this GameObject.
	 * @return The square of the weapons range in game-space units.
	 */
	public abstract float weaponRangeSquared();
	/** Determines the distance to scan for nearby enemies.
	 * By default the range is equal to the weapon range.
	 * If it is higher, a Unit can detect a distant enemy and close the
	 * gap in order to fire.
	 * @return The square of the distance to scan for nearby enemies.
	 */
	public float scanRangeSquared() { return weaponRangeSquared(); }
	/** Return the number of frames to wait between firing shots.
	 */
	public abstract int weaponDelay();
	
	/**If a turret is available, rotate it toward the target.
	 * @return true iff the target is within the firing arc.
	 */
	protected abstract boolean aim();
	
	//Fire a shot. Return true if you did. Default version is for unarmed things.
	/** Attempt to fire a shot at the target.
	 * @return true iff the shot was successfully fired.
	 */
	protected boolean fire() {
		return false;
	}
	
	/** Arbitrary initialization. Called by newGameObject() with a passed in parameter.
	 * param p An integer which may be used or ignored by the GameObject, as needed.
	 */
	protected void param(int p) {
		return;
	}
	
	/** Get the Color for displaying this object on the minimap.
	 * GameObjects are displayed as single pixels on the minimap, so
	 * a Color is sufficient to draw them.
	 * @return Unless overridden, this returns Color.orange.darker() for neutrals, Team Color for non-neutrals.
	 */
	public Color getMinimapColor() {
		//return teamcolor;
		if(myPlayer == null)
			return Color.orange.darker();
		else
			return myPlayer.getColor();
	}
	
	/** Return true if the object is not a valid target for attacks nor following.
	 * This is always true for indestructable obstacles.
	 * Otherwise, it is true only when the Unit/obstacle is destroyed.
	 * This is necessary to allow a GameObject to become completely dereferenced.
	 * @return True iff the unit is destroyed or it is both immobile and indestructable.
	 */
	public boolean isDead() {
		return true;
	}
	
	/** Return true if an explosion can possibly damage this object.
	 * @return True iff the object is damageable.
	 */
	public boolean damageable() {
		return false;
	}
	/** Return true if a healer can possibly restore life to the object.
	 * @return True iff the object is repairable.
	 */
	public boolean repairable() {
		return false;
	}
	/** Return true if a paralyzing weapon can possibly stun this object.
	 * @return True iff the object is paralyzable.
	 */
	public boolean paralyzable() {
		return false;
	}
	
	/** Apply damage to this object. A GameObject can apply its own rules for
	 * taking damage. The 'standard' is to track a health integer, which is
	 * reduced by (dam - armor) for each hit, with a minimum loss of 1 per hit.
	 * Healing effects call this method with a negative parameter.
	 * @param dam The number of damage points to be inflicted.
	 */
	public void recieveDamage(int dam) {}
	/** Apply stun effects to this object. A GameObject can apply its own rules for
	 * being stunned. The 'standard' is to skip a number of updates equal to the
	 * level of paralysis.
	 * @param level The strength of the paralyzer.
	 */
	public void recieveParalysis(int level) {}
	
	/** Cause the HexViewer's view to be centered on this GameObject. */
	public void center(Transform t) {
		Point2D pt = t.getPoint2D(vr[0]);
		t.translate(t.maxX() / 2 - (int)pt.x, t.maxY() / 2 - (int)pt.y);
	}
	/** Returns the cost to build this object.
	 * Non-buildable objects have a cost of zero.
	 * @return The cost of the object.
	 */
	public int cost() {
		return 0;
	}
	/** A String[] that holds all the propery names of this object. (in order) Capitalized to remind the programmer to return a static final String[]
         * @return  */
	abstract protected String[] PROPERTIES();
        /** returns a String for the <CODE>p</CODE>th property of this object.
         */        
	abstract protected String getProperty(int p);
        /** Returns the property of this object, named by the <CODE>p</CODE> argument.
         * @throws Exception When the property is not found.
         */        
	public final String GetProperty(String p) throws Exception {
		for(int t = 0; t < PROPERTIES().length ; t++) {
			if(PROPERTIES()[t].equals(p))
				return getProperty(t);
		}
		throw new Exception(getClass().getName() + " class does not have the property " + p);
	}
        /** Returns an array of arrays of the properties of this object. [0][] is the property name, [1][] is the property's value.
         */        
	public final String[][] getProperties() {
		String[][] ret = new String[2][PROPERTIES().length];
		for(int t = 0; t < PROPERTIES().length ; t++ ) {
			ret[0][t] = PROPERTIES()[t];
			ret[1][t] = getProperty(t);
		}
		return ret;
	}
	/** Eliminates the visibility of a GameObject.
	 * This is added only for the mapper.
	 */
	public abstract void killGraphics();
        /** Return health or other status indicator as a fraction.
         * 0 = Dead. 1 = Full health
         * @return a value from 0 to 1 indicating healthiness.
         */
        public float getStatusFraction() {
                return 1.0f;
        }
}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
热久久国产精品| 懂色一区二区三区免费观看| 奇米影视7777精品一区二区| 日本不卡视频在线观看| 成人久久久精品乱码一区二区三区| av不卡在线播放| 26uuu国产在线精品一区二区| 日韩伦理免费电影| 韩国欧美一区二区| 欧美日韩高清不卡| 亚洲精品视频一区| 成人国产亚洲欧美成人综合网 | 日本一区二区三区在线不卡| 亚洲午夜在线观看视频在线| 成人性视频免费网站| 欧美成人高清电影在线| 亚洲第一在线综合网站| 色8久久精品久久久久久蜜| 久久青草欧美一区二区三区| 日韩高清在线观看| 欧美区一区二区三区| 亚洲欧美日韩人成在线播放| 国产91在线|亚洲| 久久精品男人的天堂| 国产在线看一区| 日韩一级免费一区| 欧美a一区二区| 91麻豆精品国产综合久久久久久| 夜夜嗨av一区二区三区四季av | 欧美国产乱子伦 | 欧美va亚洲va在线观看蝴蝶网| 亚洲日本va午夜在线电影| 国产成人精品aa毛片| 国产欧美日韩在线看| 国模一区二区三区白浆| 2023国产一二三区日本精品2022| 免费成人在线观看| 精品久久久三级丝袜| 久久精品国产在热久久| 日韩网站在线看片你懂的| 奇米色777欧美一区二区| 欧美一区二区人人喊爽| 久久综合综合久久综合| 久久久久久久久久久久久久久99 | 日韩一区二区三区视频| 日本欧美大码aⅴ在线播放| 欧美一级夜夜爽| 久久精品国产免费看久久精品| 7777精品久久久大香线蕉| 丝袜脚交一区二区| 精品处破学生在线二十三| 国产精品自拍av| 亚洲欧美综合另类在线卡通| 日本电影亚洲天堂一区| 天堂va蜜桃一区二区三区| 欧美不卡一区二区三区四区| 欧美日韩黄色一区二区| 日韩成人一区二区三区在线观看| 日韩一卡二卡三卡国产欧美| 国产一区二区电影| 亚洲少妇最新在线视频| 欧美日韩亚洲不卡| 国产麻豆精品theporn| 亚洲色欲色欲www| 91精品国产91综合久久蜜臀| 国产激情偷乱视频一区二区三区| 亚洲欧美日韩国产中文在线| 91麻豆精品国产91久久久 | 日韩欧美二区三区| 成人午夜电影网站| 肉色丝袜一区二区| 欧美激情自拍偷拍| 欧美亚洲高清一区二区三区不卡| 蜜臀av亚洲一区中文字幕| 欧美国产国产综合| 在线播放中文一区| 丁香桃色午夜亚洲一区二区三区| 一区二区三区在线视频免费| 日韩欧美国产电影| 91小视频免费观看| 九色综合狠狠综合久久| 一区二区视频在线| 国产人成一区二区三区影院| 欧美日韩另类一区| 成人黄页毛片网站| 美洲天堂一区二卡三卡四卡视频| 中文字幕亚洲成人| 久久综合久久鬼色| 91精品综合久久久久久| 91蜜桃传媒精品久久久一区二区 | 亚洲精品老司机| 精品免费99久久| 欧美三日本三级三级在线播放| 国产精一区二区三区| 日韩激情一区二区| 亚洲免费观看在线视频| 国产欧美精品一区aⅴ影院 | 亚洲国产美国国产综合一区二区| 国产欧美日韩三区| 精品国产免费一区二区三区四区 | 福利电影一区二区| 蜜桃视频一区二区三区在线观看| 一区二区三区**美女毛片| 国产精品三级视频| 国产欧美精品一区aⅴ影院| 欧美大黄免费观看| 日韩三级视频在线观看| 欧美午夜一区二区三区| 欧美videos中文字幕| 欧美精品免费视频| 欧美日本国产视频| 欧美美女一区二区三区| 欧美色网一区二区| 欧美日韩在线电影| 欧美性感一类影片在线播放| 色综合天天综合| 91色porny在线视频| 91免费视频观看| 色婷婷精品大在线视频| 99久久久国产精品免费蜜臀| 国产精品一区二区在线观看网站| 久草中文综合在线| 国产精品亚洲专一区二区三区| 狠狠色综合播放一区二区| 蜜臀av性久久久久蜜臀aⅴ四虎 | 一区二区三区欧美视频| 自拍偷拍欧美激情| 亚洲精品视频免费观看| 亚洲一区在线免费观看| 亚洲成人免费影院| 午夜精品视频一区| 男人操女人的视频在线观看欧美| 久久99国产精品尤物| 国产成人免费在线观看不卡| 丁香婷婷深情五月亚洲| 色狠狠一区二区| 在线成人小视频| 久久一夜天堂av一区二区三区| 日本一区二区三区久久久久久久久不| 中文字幕第一区综合| 亚洲精品视频在线观看免费| 亚洲va中文字幕| 国产综合色在线| 97国产精品videossex| 欧洲在线/亚洲| 欧美不卡一区二区| 成人欧美一区二区三区小说| 亚洲成人免费电影| 国产一区二区不卡在线 | 粉嫩一区二区三区在线看| 成人av在线一区二区三区| 欧美综合一区二区三区| 日韩三级.com| 国产精品成人午夜| 青青草精品视频| 不卡的电影网站| 日韩欧美一区二区三区在线| 中文字幕一区二区在线观看 | 成人18视频日本| 欧美日韩不卡视频| 中文字幕+乱码+中文字幕一区| 亚洲一区视频在线| 久久99精品国产.久久久久久| 99麻豆久久久国产精品免费 | 91色在线porny| 欧美成人免费网站| 伊人一区二区三区| 国产自产高清不卡| 欧美美女一区二区| 亚洲少妇最新在线视频| 国精产品一区一区三区mba桃花| 色婷婷综合五月| 日本一区二区三区免费乱视频 | 亚洲免费观看在线观看| 国产在线精品不卡| 欧美一区二区三区视频免费| 亚洲视频免费观看| 成人sese在线| 国产午夜精品一区二区三区嫩草 | 亚洲免费在线视频| 国产98色在线|日韩| 欧美电影免费观看高清完整版在线| 亚洲欧美国产高清| 成人av资源站| 久久久亚洲精品一区二区三区| 亚洲一区二区三区中文字幕 | 亚洲午夜成aⅴ人片| www.欧美日韩国产在线| 欧美激情资源网| 国产91对白在线观看九色| 久久只精品国产| 精彩视频一区二区| 日韩精品一区二区三区在线| 奇米色777欧美一区二区| 欧美日韩国产综合草草| 夜夜嗨av一区二区三区中文字幕 | 天天综合天天做天天综合| 色婷婷精品久久二区二区蜜臂av| 国产精品久久久久9999吃药| 国产成人在线观看免费网站|