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

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

?? command.java

?? 用java開發的一個實施策略游戲源碼 值得學習一下
?? 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.game;
import netwar.utils.*;
import java.io.Serializable;

/**
 * A collection of Integers to indicate a player's decision to influence the game.
 * <p>
 * The action codes are as follows: <BR>
 * 0 = No command. Used for synchronizing games over the network.<BR>
 * 1 = New game object.<BR>
 *   Param 1 = x, Param 2 = y (in hex coordinates).<BR>
 *   In this case, selection[0] identifies the type to be created.<BR>
 * 2 = Set goal: location. Selected units try to get to a location.<BR>
 *   Param 1 = x, Param 2 = y (in hex coordinates).<BR>
 * 3 = Set goal: unit. Selected units try to approach/follow a Unit.<BR>
 *     If that Unit is an enemy, the units will try to destroy it.<BR>
 *   Param 1 = unit index for target. Param 2 not used.<p>
 * Additional action codes will be added as needed. Keep in mind that these will
 * never include interface controls (such as zooming or scrolling) nor will it
 * include all of the detail actions Units can perform, only the macroscopic
 * actions that can be assigned by a player.<p>
 * Note: The index used by command will be a unique identifier for the GameObject, not
 * merely the array index, which would be easy to look up. This is because indices could
 * change before the Command is executed. The GameObject referenced could even be deleted
 * in that time! 
 * @author Group N2 - Project Netwar
 * @author Daniel Grund
 */
public class Command implements Serializable {
	int action;
	int player;
	int selection[];
	int param1;
	int param2;
	//int param3... if needed, we can expand it.

	/** The set of local commands which need to be sent to other players.
	 * These will not be executed until they are echoed from the server.
	 * These commands are queued as they are generated and sent to the
	 * server at a fixed rate (expected to be one per frame).
	 * The array queue was deemed optimal for this, as it will not usually
	 * grow very large, but should have the capacity for extra growth.
	 */
	public static Queue pendingCommands = new AQueue();

	/** The set of commands collected from the network.
	 * This includes one command sent from this computer and echoed by the server.
	 * These will be executed this cycle, and replaced before the next cycle.
	 * The number needed for this collection equals to number of players, and will
	 * not increase, so a basic array is adequate.
	 */
	public static Command currentCommands[] = new Command[0];
	
	/** Indicates that the currentCommands contains the Command objects for
	 * the next cycle.
	 */
	public static boolean commandsUpToDate = false;

	public static Command empty = new Command(0,0,new int[0],0,0);
	
	/** Create the command.
	 * @param a action code.
	 * @param pl player number.
	 * @param sel array of indices for the selected game objects.
	 * @param p1 parameter 1 for the command.
	 * @param p2 parameter 2 for the command.
	 */
	public Command(int a, int pl, int[] sel, int p1, int p2) {
		action = a;
		player = pl;
		if(sel == null)
			selection = null;
		else{
			selection = new int[sel.length];
			for(int i = 0; i < sel.length; i++)
				selection[i] = sel[i];
		}
		param1 = p1;
		param2 = p2;
	}
	/** Execute the command. Makes the command take effect.
	 * What the command will do depends primarily on the action code.
	 * This should be called once per Command, then the Command should be discarded.
	 * As a precaution, the action will be set to 0 after executing the action.
	 */
	public void execute() {
		int i; //loop variable
		GameObject go1, go2; //References obtained with IDs
		switch(action) {
			case 0:
			return;
			case 1:
				//Make a new object
			    //This should call the correct player's base.
                            Base base = Player.getPlayer(player).getBase();
                            if(base != null)
                                base.spawnUnit(param1, player);
			break;
			case 2:
				//setGoal(param1,param2);
				for(i = 0; i < selection.length; i++)
				{
					go1 = GameObject.getObjectWithID(selection[i]);
					if(go1 != null)
						go1.setGoal(param1, param2);
				}
			break;
			case 3:
				//setGoal((GameObject)param1);
				go2 = GameObject.getObjectWithID(param1);
				if(go2 != null) {
					for(i = 0; i < selection.length; i++)
					{
						go1 = GameObject.getObjectWithID(selection[i]);
						if(go1 != null) {
							if(go1 == go2)
								go1.setGoal();
							else
								go1.setGoal(go2);
						}
					}
				}else{
					for(i = 0; i < selection.length; i++)
					{
						go1 = GameObject.getObjectWithID(selection[i]);
						if(go1 != null)
							go1.setGoal();
					}
				}
			break;
		}
		action = 0;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线视频免费播放| 精品一区二区三区久久| 麻豆精品蜜桃视频网站| 日韩色在线观看| 麻豆精品蜜桃视频网站| 久久久国产精品麻豆| 国产精品资源在线看| 中文字幕中文字幕中文字幕亚洲无线 | 亚洲欧洲国产日本综合| 99r精品视频| 亚洲成人精品一区二区| 欧美r级电影在线观看| 国产精品香蕉一区二区三区| 国产精品久久毛片| 欧美日韩一区在线观看| 麻豆91小视频| 中文字幕一区二区在线观看 | 老司机精品视频在线| 久久亚洲精品国产精品紫薇| av在线这里只有精品| 亚洲综合色区另类av| 欧美一区二区三区公司| 国产成人av一区二区三区在线观看| 亚洲欧洲日韩av| 欧美人妖巨大在线| 国产酒店精品激情| 一区二区高清视频在线观看| 日韩久久久久久| 92精品国产成人观看免费| 日韩成人午夜精品| 国产精品久久久一本精品 | 日韩有码一区二区三区| 日本一区二区三区在线不卡| 欧美日韩精品一区二区在线播放| 久久99在线观看| 一区二区三区美女| 国产亚洲一区二区在线观看| 欧美三级电影在线观看| 国产福利精品导航| 天涯成人国产亚洲精品一区av| 亚洲国产经典视频| 欧美一级二级在线观看| 91小视频在线| 国产老妇另类xxxxx| 亚洲成人av电影在线| 中文字幕欧美一| 久久奇米777| 在线不卡中文字幕播放| 91在线免费视频观看| 国产中文一区二区三区| 日韩成人精品在线观看| 亚洲综合色成人| 最新中文字幕一区二区三区| 亚洲精品一区二区三区在线观看 | 欧美日韩国产乱码电影| 成人av电影在线| 极品少妇xxxx偷拍精品少妇| 午夜精品爽啪视频| 亚洲一区视频在线| 亚洲少妇屁股交4| 中文在线资源观看网站视频免费不卡| 日韩亚洲欧美在线观看| 在线电影院国产精品| 欧美三级日韩在线| 色拍拍在线精品视频8848| av在线综合网| 99re66热这里只有精品3直播| 国产精品白丝jk白祙喷水网站| 美脚の诱脚舐め脚责91| 日韩激情视频在线观看| 五月激情六月综合| 午夜久久久久久久久| 亚洲高清免费一级二级三级| 亚洲美女免费视频| 亚洲精品国产高清久久伦理二区| 国产精品短视频| 最新国产の精品合集bt伙计| 国产精品青草综合久久久久99| 国产日韩v精品一区二区| 国产色91在线| 国产精品久久久久影院老司 | 亚洲欧洲日韩在线| 综合激情成人伊人| 亚洲精品免费电影| 亚洲一区在线观看免费| 午夜欧美在线一二页| 日本欧美肥老太交大片| 免费看日韩精品| 国产一区视频网站| 国产成人无遮挡在线视频| 国产99精品视频| av爱爱亚洲一区| 91福利在线看| 欧美精品成人一区二区三区四区| 欧美日韩国产一级| 精品日韩欧美一区二区| 国产视频视频一区| 亚洲蜜臀av乱码久久精品| 亚洲第一会所有码转帖| 久久精品国产一区二区三区免费看| 久久机这里只有精品| 国产成人免费av在线| 97久久精品人人澡人人爽| 欧美在线观看视频一区二区三区| 欧美精品第1页| 国产色综合久久| 亚洲综合色婷婷| 精品一区二区三区久久| 91在线视频免费观看| 91精品国产综合久久精品图片| 2019国产精品| 亚洲一区二区视频在线观看| 麻豆成人久久精品二区三区红| 国产不卡视频一区二区三区| 欧美视频在线一区| www国产精品av| 亚洲精品水蜜桃| 久久www免费人成看片高清| 99在线精品免费| 日韩视频免费观看高清完整版| 中文字幕av不卡| 美女国产一区二区三区| 色综合天天天天做夜夜夜夜做| 日韩三区在线观看| 亚洲丝袜精品丝袜在线| 美国十次综合导航| 欧美午夜在线观看| 中文字幕精品一区二区三区精品| 午夜精品视频一区| 精品精品欲导航| 亚洲乱码精品一二三四区日韩在线 | 欧美日韩精品欧美日韩精品一综合| 久久无码av三级| 天天影视涩香欲综合网| av一区二区三区在线| 欧美一级精品在线| 亚洲综合久久av| 成人av资源下载| 久久久综合九色合综国产精品| 肉肉av福利一精品导航| 日本乱人伦aⅴ精品| 国产日韩欧美制服另类| 日本不卡视频在线| 欧美三日本三级三级在线播放| 中文字幕免费在线观看视频一区| 蜜臀久久久久久久| 欧美丝袜第三区| 亚洲欧美精品午睡沙发| 成人深夜在线观看| 精品国产乱码久久久久久图片| 午夜激情一区二区三区| 色999日韩国产欧美一区二区| 国产欧美一二三区| 久久er精品视频| 日韩写真欧美这视频| 亚洲一区在线免费观看| 色www精品视频在线观看| 福利一区福利二区| 久久亚洲捆绑美女| 国产一区二区影院| 久久亚洲欧美国产精品乐播| 久久国产麻豆精品| 欧美成人精精品一区二区频| 日韩精品三区四区| 制服视频三区第一页精品| 亚洲成人tv网| 91精品国产综合久久精品性色| 日韩专区在线视频| 欧美一级高清大全免费观看| 免费看日韩a级影片| 91精品国产综合久久精品图片 | 国产精品国产三级国产aⅴ原创| 国产精品亚洲综合一区在线观看| 久久众筹精品私拍模特| 九色综合狠狠综合久久| 欧美本精品男人aⅴ天堂| 国产一区二区成人久久免费影院 | 欧美日韩和欧美的一区二区| 一片黄亚洲嫩模| 欧美日韩一区 二区 三区 久久精品| 亚洲一区中文日韩| 在线综合+亚洲+欧美中文字幕| 美女网站一区二区| 久久香蕉国产线看观看99| 福利一区二区在线| 亚洲精品国产第一综合99久久| 欧美日韩一级黄| 美美哒免费高清在线观看视频一区二区 | √…a在线天堂一区| 日本韩国一区二区三区视频| 亚洲18女电影在线观看| 日韩亚洲欧美一区二区三区| 狠狠色丁香久久婷婷综合_中| 久久久久久电影| 91国产福利在线| 蜜桃av噜噜一区| 国产精品国产三级国产三级人妇| 在线观看日韩国产| 蜜桃传媒麻豆第一区在线观看| 国产欧美一区二区精品性色超碰|