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

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

?? boardhelper.java

?? good project for programmer,,
?? JAVA
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
package com.sillysoft.lux.util;import com.sillysoft.lux.*;////  BoardHelper.java//  Lux////  Copyright (c) 2002-2007 Sillysoft Games. All rights reserved.//import java.util.List;import java.util.ArrayList;import java.util.Vector;/** This class is a collection of static methods for getting information out of a set of countries. <p>The majority of the methods in this class require a final parameter of Country[] countries.  If the method calls for countries, do not attempt to pass in anything less than the entire board.  Failure to do so will resultin undefined behavior.<p>There are three groups of methods in this class:  Those that return information about the state of the game, those that return information aboutthe state of the board layout, and those that return paths between countries and/or continents.  <p>Have fun.*/public class BoardHelper {/** Returns the country owned by <i>player</i> with the most armies on it.<p>This method first searches through all the <i>countries</i> looking for those which are owned by <i>player</i>.  Once it has that list, it inspects eachto find out how many armies are on, and makes a note of whichever has the most.<p>To find the countries owned by <i>player</i>, it uses a PlayerIterator.<p>In the event that <i>player</i> is invalid, or is no longer in the game, the value returned is null.<p>* @param player 	the player interested in* @param countries  the board* @return   		A country object* @see CountryIterator* @see PlayerIterator*/public static Country getPlayersBiggestArmy( int player, Country[] countries )	{	CountryIterator armies = new PlayerIterator(player,countries);	int biggestArmies = -1;	Country root = null;	while (armies.hasNext())		{		Country a = armies.next();		if (a.getArmies() > biggestArmies)			{			biggestArmies = a.getArmies();			root = a;			}		}	return root;	}/** Same as getPlayersBiggestArmy() except it will return the biggest army that has at least one enemy neighbor. Will return null if the player has no countries. */public static Country getPlayersBiggestArmyWithEnemyNeighbor( int player, Country[] countries )	{	CountryIterator armies = new PlayerIterator(player,countries);	int biggestArmies = -1;	Country root = null;	while (armies.hasNext())		{		Country a = armies.next();		if (a.getArmies() > biggestArmies && a.getNumberEnemyNeighbors() > 0)			{			biggestArmies = a.getArmies();			root = a;			}		}	return root;	}		/** This method calculates the total number of armies owned by <i>player</i>.	<p>This method first searches through all the <i>countries</i> looking for those which are owned by <i>player</i>.  Once it has that list, it inspects eachto find out how many armies are on, and adds them together for a grandtotal.<p>To find the countries owned by <i>player</i>, it simply iterates over theentire board (ie, each Country in <i>countries</i>).  It does not use a PlayerIterator.<p>In the event that <i>player</i> is invalid, or is no longer in the game, the value returned is zero.<p>* @param player 	the player interested in* @param countries  the board* @return   		An integer* @see Country*/public static int getPlayerArmies( int player, Country[] countries )	{	int enemies = 0;	for (int i = 0; i< countries.length; i++)		{		if (countries[i].getOwner() == player)			enemies += countries[i].getArmies();		}		return enemies;	}	/** This method calculates the number of countries owned by <i>player</i>.<p>This method first searches through all the <i>countries</i> looking for those which are owned by <i>player</i>.  As it finds them, it increments a value,which, when finished, is returned to the caller.<p>To find the countries owned by <i>player</i>, it simply iterates over theentire board (ie, each Country in <i>countries</i>).  It does not use a PlayerIterator.<p>In the event that <i>player</i> is invalid, or is no longer in the game, the value returned is zero.<p>* @param player 	the player interested in* @param countries  the board* @return   		An integer* @see Country* @see CountryIterator* @see PlayerIterator*/public static int getPlayerCountries( int player, Country[] countries )	{	int number = 0;	for (int i = 0; i< countries.length; i++)		{		if (countries[i].getOwner() == player)			number++;		}		return number;	}	/** This method calculates the number of armies owned by <i>player</i> in <i>continent</i>.<p>This method first searches through all the <i>countries</i> looking for those which are part of <i>continent</i>.  Once it has that list, it inspects eachto find out first if it is owned by <i>player</i>, and then adds the numberof armies on it to a counter if so.  The final value in the counter iswhat is returned.<p>To find the countries in the <i>continent</i>, it uses a ContinentIterator.<p>In the event that <i>player</i> is invalid, or is no longer in the game, the value returned is zero.<p>In the event that <i>continent</i> is invalid, the value returned is zero. <p>* @param player 	the player interested in* @param continent  the continent interested in* @param countries  the board* @return   		An integer* @see Country* @see CountryIterator* @see ContinentIterator*/public static int getPlayerArmiesInContinent( 							int player, int continent, Country[] countries )	{	int enemies = 0;	CountryIterator continentE = new ContinentIterator(continent, countries);	while (continentE.hasNext()) {		Country c = continentE.next();		if (c.getOwner() == player)			enemies += c.getArmies();		}		return enemies;	}/** this method calculates the number of armies owned by anyone who is NOT <i>player</i> in <i>continent</i>.<p>This method first searches through all the <i>countries</i> looking for those which are part of <i>continent</i>.  Once it has that list, it inspects eachto find out first if it is owned by <i>player</i>, and then adds the numberof armies on it to a counter if <i><b>not</b></i>.  The final value in the counter is what is returned.<p>To find the countries in the <i>continent</i>, it uses a ContinentIterator.<p>In the event that <i>player</i> is invalid, or is no longer in the game, the value returned is the total number of armies on the <i>continent</i> regardless of which player they belong to.<p>In the event that <i>continent</i> is invalid, the value returned is zero. <p>* @param player 	the player interested in* @param continent  the continent interested in* @param countries  the board* @return   		An integer* @see Country* @see CountryIterator* @see ContinentIterator*/public static int getEnemyArmiesInContinent(   							int player, int continent, Country[] countries )	{	int enemies = 0;	CountryIterator continentE = new ContinentIterator(continent, countries);	while (continentE.hasNext()) {		Country c = continentE.next();		if (c.getOwner() != player)			enemies += c.getArmies();		}		return enemies;	}	/** Get the number of armies owned by the player that are in countries that directly adjoin the given continent. */public static int getPlayerArmiesAdjoiningContinent(int ID, int cont, Country[] countries)	{	int[] borders = BoardHelper.getContinentBorders(cont, countries);	// Make a list of the countries that must be counted - to avoid duplicate counting	List adjoining = new ArrayList();	for (int b = 0; b < borders.length; b++)		{		Country[] neighbors = countries[ borders[b] ].getAdjoiningList();		for (int j = 0; j < neighbors.length; j++)			if (neighbors[j].getOwner() == ID && neighbors[j].getContinent() != cont && ! adjoining.contains(neighbors[j]))				adjoining.add(neighbors[j]);		}		int result = 0;		for (int b = 0; b < adjoining.size(); b++)		result += ((Country)adjoining.get(b)).getArmies();	return result;	}	/** This method checks if <i>player</i> still owns any countries.<p>This method first searches through all the <i>countries</i> looking for those which are owned by <i>player</i>.  If it finds one, it immediatly stopslooking and returns true.  If no country is found with <i>player</i> asthe owner, then it returns false.<p>To find a country owned by <i>player</i>, it simply iterates over theentire board (ie, each Country in <i>countries</i>).  It does not useany type of Iterator.<p>In the event that <i>player</i> is invalid, or is no longer in the game, the value returned is the total number of armies on the <i>continent</i> regardless of which player they belong to.<p>In the event that <i>player</i> is invalid, or is no longer in the game, the value returned is false.<p>This method could be used to determine if any countries are unchosen duringthe initial selection process by passing in a -1 as the <i>player</i>.The use of the resulting information is dubious, at best, and other routines exist that are better suited to this use.  <p>* @param player 	the player interested in* @param countries  the board* @return   		A boolean (true or false)* @see Country* @see BoardHelper#playerOwnsContinentCountry* @see BoardHelper#getSmallestOpenCont* @see BoardHelper#getSmallestEmptyCont*/public static boolean playerIsStillInTheGame( int player, Country[] countries )	{	// We cycle through the countries:		for (int i = 0; i < countries.length; i++)		{		// If we find a country that player owns, we return true:		if (countries[i].getOwner() == player)				return true;		}	// If it got to here then player doesn't own any countries (and is 	// therefore out of the game).	return false;	}/** Returns the number of continents.<p>This method first increments a counter, looking for a null return valuefrom ContinentIterator.  The value returned is the counter, less one.<p>* @param countries  the board* @return   		An integer* @see Country* @see CountryIterator* @see ContinentIterator*/public static int numberOfContinents( Country[] countries )	{	// there are a variable number of continents, so keep looking until 	// one doesn't exist	boolean lastContExisted = true;			int i;	for (i = 0; lastContExisted; i++) 		{		lastContExisted = false;		ContinentIterator iter = new ContinentIterator( i, countries );		if (iter.hasNext()) 			{			lastContExisted = true;			}		}	return i-1;	}/** Returns the number of countries in <i>continent</i>.<p>This method first searches through all the <i>countries</i> looking for those which are part of <i>continent</i>.  Once it has that list, it simply iterates over the list and increments a counter as it does so.<p>To find the countries in the <i>continent</i>, it uses a ContinentIterator.<p>In the event that <i>continent</i> is invalid, the value returned is zero. <p>* @param continent  the continent interested in* @param countries  the board* @return   		An integer* @see Country* @see CountryIterator* @see ContinentIterator*/public static int getContinentSize(int continent, Country[] countries)	{	int count = 0;	ContinentIterator iter = new ContinentIterator( continent, countries );	while (iter.hasNext()) {		iter.next();		count++;		}	return count;	}/** Returns the code of a country inside <i>continent</i>.<p>This method first searches through all the <i>countries</i> looking for those which are part of <i>continent</i>.  Once it has that list, it simply iterates over the list and increments a counter as it does so.<p>To find the countries in the <i>continent</i>, it uses a ContinentIterator.<p>In the event that <i>continent</i> is invalid, the value returned is zero. <p>* @param continent  the continent interested in* @param countries  the board* @return   		An integer* @see Country* @see CountryIterator* @see ContinentIterator

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲精品7777| 99国产精品国产精品久久| 久草在线在线精品观看| 国产日韩一级二级三级| 精品国产乱码久久久久久1区2区| 国产伦理精品不卡| 7777精品伊人久久久大香线蕉| 欧美色老头old∨ideo| av在线播放一区二区三区| 欧美videos大乳护士334| 色婷婷精品久久二区二区蜜臀av | 亚洲午夜免费电影| 国产精品国产三级国产普通话蜜臀 | 久久美女艺术照精彩视频福利播放| 在线观看成人小视频| 成人av在线网| a4yy欧美一区二区三区| 麻豆精品视频在线观看| 97久久精品人人做人人爽50路| 在线成人av影院| 欧美性色欧美a在线播放| 在线观看成人免费视频| 一区在线中文字幕| 91麻豆swag| 在线视频一区二区三| 国产精品灌醉下药二区| 国产精一品亚洲二区在线视频| 成人h动漫精品| 亚洲国产成人一区二区三区| 狠狠色狠狠色合久久伊人| 国产成a人无v码亚洲福利| 91在线无精精品入口| 欧美国产在线观看| 久久爱另类一区二区小说| 国产91精品入口| 久久精品免费在线观看| 日日夜夜精品视频天天综合网| 美女在线观看视频一区二区| 人人爽香蕉精品| 成人黄色一级视频| 成人av网址在线| 亚洲视频一二三| 亚洲欧美成aⅴ人在线观看| 午夜欧美2019年伦理| 一区二区三区中文在线| 成人在线综合网站| 91国偷自产一区二区三区观看| 欧美一区二区女人| 国产精品国产三级国产普通话蜜臀 | 99久久99久久综合| 一区二区三区不卡视频| 7777精品伊人久久久大香线蕉经典版下载 | 国产精品视频观看| 欧美性欧美巨大黑白大战| 91小视频在线免费看| 日韩一区二区三区电影在线观看 | 国产激情视频一区二区三区欧美 | 视频一区二区三区入口| 亚洲精品老司机| 亚洲欧美另类久久久精品 | 风流少妇一区二区| 高清不卡一二三区| 91麻豆精品国产91久久久久| 在线不卡a资源高清| 免费成人在线网站| 91成人免费电影| 性久久久久久久久| 视频一区视频二区中文字幕| 9191久久久久久久久久久| 激情av综合网| 成人av综合一区| 亚洲一区二区精品视频| 午夜在线电影亚洲一区| 7777精品伊人久久久大香线蕉超级流畅 | 精品电影一区二区三区| 精品剧情v国产在线观看在线| 国产一区激情在线| 26uuu精品一区二区| 欧美激情综合五月色丁香小说| 国内精品视频666| 一区二区三区在线视频免费 | 国产一区二区三区日韩| 亚洲日本免费电影| 91麻豆精品国产91久久久更新时间 | 三级精品在线观看| 国产视频不卡一区| 热久久久久久久| 中文字幕精品三区| 欧美丰满一区二区免费视频| 久久精品国产久精国产| 一区二区三区日韩欧美精品 | 国产亚洲欧美色| 91成人在线免费观看| 国产乱码精品1区2区3区| 一区二区三区在线视频观看58| 久久蜜桃香蕉精品一区二区三区| 中文字幕一区二区三区不卡| 91麻豆精品国产91久久久资源速度| 成人国产亚洲欧美成人综合网| 91精品国产综合久久久久久久久久 | 国产主播一区二区| 色婷婷久久久亚洲一区二区三区| 亚洲色图制服丝袜| 欧美夫妻性生活| 亚洲一二三四在线| 欧美日韩高清一区二区不卡| 91性感美女视频| 久久综合九色综合欧美就去吻| 色综合久久66| 国产成人一区在线| 奇米精品一区二区三区在线观看一| 337p日本欧洲亚洲大胆色噜噜| 成人免费视频视频在线观看免费| 久久99国产精品免费网站| 亚洲视频一区在线观看| 国产偷国产偷精品高清尤物| 日韩精品一区二区三区中文不卡 | 床上的激情91.| 国产美女精品人人做人人爽| 日本美女一区二区| 成人一区二区三区中文字幕| 免费在线看一区| 爽爽淫人综合网网站| 一区二区激情视频| 亚洲三级电影网站| 亚洲日本乱码在线观看| 国产喷白浆一区二区三区| 欧美色爱综合网| 国产欧美日韩视频一区二区| 欧美性猛片xxxx免费看久爱| 91福利视频在线| 欧美视频一区二区| 欧美丰满少妇xxxxx高潮对白| 精品视频一区 二区 三区| 欧美日韩一区二区不卡| 在线观看区一区二| 欧美日韩午夜精品| 欧美丰满少妇xxxxx高潮对白| 4438亚洲最大| 精品国产一区二区三区四区四| 欧美电影免费提供在线观看| 精品久久久久久久久久久久久久久| 欧美精选一区二区| 日韩一级精品视频在线观看| 精品少妇一区二区| 国产视频一区不卡| 亚洲美女在线一区| 亚洲va韩国va欧美va精品| 免费成人结看片| 国产成人亚洲综合a∨婷婷| 丁香天五香天堂综合| 中文字幕av在线一区二区三区| 国产精品丝袜一区| 亚洲综合久久久久| 蜜桃91丨九色丨蝌蚪91桃色| 极品少妇一区二区三区精品视频| 粉嫩13p一区二区三区| 91小视频免费观看| 538prom精品视频线放| 日韩免费观看高清完整版| 久久久影视传媒| 亚洲图片另类小说| 老司机精品视频导航| 粉嫩av一区二区三区粉嫩| 99久久综合99久久综合网站| av不卡一区二区三区| 成人av资源网站| 欧美刺激脚交jootjob| 国产精品久久久久久久午夜片| 亚洲国产一区视频| 国产一区二区三区不卡在线观看 | 96av麻豆蜜桃一区二区| 欧美性猛交xxxxxx富婆| 欧美亚洲一区二区在线观看| 欧美亚洲一区二区三区四区| 免费观看一级特黄欧美大片| 国产精品区一区二区三区| 成人激情综合网站| 91国产丝袜在线播放| 欧美成人高清电影在线| 欧美一区二区三区视频在线观看| 中文字幕av免费专区久久| 免费观看一级特黄欧美大片| 91丨九色丨蝌蚪富婆spa| 精品乱人伦一区二区三区| 亚洲成a天堂v人片| 欧美精品一区二区三区高清aⅴ | 91精品国产综合久久蜜臀| 精品不卡在线视频| 蜜臀av国产精品久久久久| 91丨porny丨蝌蚪视频| 国产精品免费丝袜| 韩国成人精品a∨在线观看| 欧美色图12p| 综合色中文字幕| 国产一区二区毛片| 久久亚洲一区二区三区四区| 午夜在线成人av| 在线一区二区三区| 国产精品伦一区二区三级视频|