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

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

?? betterpixie.java

?? good project for programmer,,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.sillysoft.lux.agent;import com.sillysoft.lux.*;import com.sillysoft.lux.util.*;////  BetterPixie.java//	Lux////  Copyright (c) 2002-2007 Sillysoft Games. //	http://sillysoft.net//	lux@sillysoft.net////	This source code is licensed free for non-profit purposes. //	For other uses please contact lux@sillysoft.net//////	BetterPixie builds a concrete agent out of SmartAgentBase to do the following...////	She picks countries in continents that have the fewest border points////	At the start of each turn (inside placeArmies) she decides what continents she will expend effort on.//  Then she will place and attack from those continents.//// 	Also she tries to get a card every turn//	She also runs attackHogWild()////	When fortifying she will fort to the borders of continents that are on the front lines.//import java.util.Random;import java.util.List;import java.util.List;import java.util.ArrayList;public class BetterPixie extends SmartAgentBase{float outnumberBy = 1;	// for individual country attacksprotected int borderForce = 20;boolean[] ourConts;	// whether we will spend efforts taking/holding each continentpublic String name()	{	return "BetterPixie";	}public float version()	{	return 1.0f;	}public String description()	{	return "BetterPixie is a lovable little sprite. She enjoys kicking your ass.";	}public void cardsPhase( Card[] cards )	{	super.cardsPhase(cards);	cashCardsIfPossible(cards);	}public int pickCountry()	{	// our first choice is the continent with the least # of borders that is totally empty	if (goalCont == -1)		{		setGoalToLeastBordersCont();		}	// so now we have picked a cont...	return pickCountryInContinent(goalCont);	}// This method is a hook that EvilPixie uses to place better during hogwildboolean placeHogWild(int numberOfArmies)	{	return false;	}// returns true if we want at least one continentboolean setupOurConts(int numberOfArmies)	{	if (ourConts == null)		ourConts = new boolean[numContinents];	// calculate the armies needed to conquer each continent	int[] neededForCont = new int[numContinents];	for (int i = 0; i < numContinents; i++)		{		neededForCont[i] = BoardHelper.getEnemyArmiesInContinent(ID, i, countries);	// enemies in the cont		neededForCont[i] *= 1.3;	// add a multiple for losses		int ourArmiesNearCont = BoardHelper.getPlayerArmiesInContinent(ID, i, countries) +								BoardHelper.getPlayerArmiesAdjoiningContinent(ID, i, countries);		// If we have a big group near the continent then consider that as well		CountryRoute bestRoute = new CountryRoute(BoardHelper.cheapestRouteFromOwnerToCont(ID, i, countries), countries);		int ourArmiesFartherAway = bestRoute.start().getArmies()									- (int)(bestRoute.costNotCountingPlayer(ID)*1.2);		neededForCont[i] -= Math.max(ourArmiesNearCont, ourArmiesFartherAway);		}	// We will only concentrate on the easiest continent to take when we own none	boolean ownNoContinents = ! BoardHelper.playerOwnsAnyPositiveContinent(ID, countries, board);	int lowestArmiesNeededToTake = 1000000;	int targetCont = -1;	boolean wantACont = false; 	// if we think we can take/hold any continents	for (int i = 0; i < numContinents; i++)		{		if (ownNoContinents)			{			if (neededForCont[i] < lowestArmiesNeededToTake && board.getContinentBonus(i) > 0)				{				lowestArmiesNeededToTake = neededForCont[i];				targetCont = i;				}			ourConts[i] = false;			}		// say we can give at most numberOfArmies/(numContinents/4) armies to each continent.		else if (neededForCont[i] < numberOfArmies/(numContinents/4.0) && board.getContinentBonus(i) > 0)			{			ourConts[i] = true;			wantACont = true;			}		else			ourConts[i] = false;		}	if (ownNoContinents)		{		if (targetCont == -1)			return false;		ourConts[targetCont] = true;		return true;		}	return wantACont;	}public void placeArmies( int numberOfArmies )	{	if (placeHogWild(numberOfArmies))		return;	// Calculate what continents we can take/hold	if (! setupOurConts(numberOfArmies))		{		// then we don't think we can take/hold any continents		placeArmiesToTakeCont( numberOfArmies, getEasiestContToTake() );		return;		}	// divide our armies amongst the conts we want	int armiesPlaced = 0;	boolean oneNeedsHelp = true;	while (armiesPlaced < numberOfArmies && oneNeedsHelp)		{		oneNeedsHelp = false;		for (int c = 0; c < numContinents; c++)			{			if (ourConts[c] && continentNeedsHelp(c))				{				debug("Placing an army to take continent "+board.getContinentName(c));				placeArmiesToTakeCont( 1, c );				armiesPlaced++;				oneNeedsHelp = true;				}			}		}	// We place the dregs if all our borders are above borderforce.	if (armiesPlaced < numberOfArmies)		placeRemainder(numberOfArmies - armiesPlaced);	}protected void placeRemainder(int numberOfArmies)	{	placeNearEnemies(numberOfArmies, true);	}/** Place our armies so they are next to enemy clusters. If 'minimumToWin' is true then place the minimum number of armies needed to conquer each cluster (starting at the smallest). If 'minimumToWin' is false then place armies evenly for each cluster. */protected void placeNearEnemies(int numberOfArmies, boolean minimumToWin)	{	// Divide all enemy countries into clusters:	List clustersWeBorder = new ArrayList();	CountryClusterSet clusters = CountryClusterSet.getAllCountriesNotOwnedBy(ID, countries);	if (minimumToWin)		clusters.orderWeakestFirst();	// Now place beside each enemy cluster	for (int i = 0; i < clusters.size() && numberOfArmies > 0; i++)		{		CountryCluster cluster = clusters.getCluster(i);		Country placeOn = cluster.getStrongestNeighborOwnedBy(ID);		if (placeOn != null)			{			int numberToPlace = numberOfArmies/clusters.size();			if (minimumToWin)				numberToPlace = cluster.estimatedNumberOfArmiesNeededToConquer() - placeOn.getArmies();			board.placeArmies(numberToPlace, placeOn);			numberOfArmies -= numberToPlace;			}		}	if (numberOfArmies > 0)		{		// we still have some left ?		// This method is AWFUL!!!		System.out.println("BetterPixie still has "+numberOfArmies+" left to place in a really bad manner");	//	Thread.dumpStack();		int i = 0;		while (numberOfArmies > 0)			{			if (countries[i].getOwner() == ID && countries[i].getNumberEnemyNeighbors() > 0)				{				board.placeArmies(1, i);				numberOfArmies--;				}			i = (i+1)%numCountries;			}		}	}boolean borderCountryNeedsHelp(Country border)	{	return border.getArmies() <= borderForce 			&& ! weOwnContsArround(border);	}// a test of whether or not we should send some armies this cont's wayprotected boolean continentNeedsHelp(int cont)	{	// if we don't own it then it definitely needs some help	if (! BoardHelper.playerOwnsContinent(ID, cont, countries) )		return true;	// otherwise we own it.	// check each border	int[] borders = BoardHelper.getContinentBorders(cont, countries);	for (int i = 0; i < borders.length; i++)		{		if (borderCountryNeedsHelp(countries[ borders[i] ]))			return true;		}	return false;	}public void attackPhase( )	{	// Try and take over all the continents we want	for (int i = 0; i < numContinents; i++)		{		if (ourConts[i])			attackInContinent(i);		}	// Take out any badly defended conts next to us	for (int i = 0; i < numContinents; i++)		takeOutContinentCheck(i);	attackForCard();	attackHogWild();	attackStalemate();	}// End of attackPhase// If we think we can take over this continent then execute lots of attacksprotected void attackInContinent( int cont )	{	// Count the enemies and friendlies:	int enemyCount = BoardHelper.getEnemyArmiesInContinent(ID, cont, countries);	// enemies in the cont	// add a multiple for losses and for the # of enemy countries

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄页毛片网站| 欧美一区二区啪啪| 成人小视频在线| 国产一区二区三区四| 国产在线一区二区综合免费视频| 国产精品久久久久久久久免费丝袜| 欧美极品少妇xxxxⅹ高跟鞋| 日韩欧美中文字幕一区| 91精品国产综合久久久久久久久久| 欧美三级电影在线看| 欧美影院精品一区| 精品国偷自产国产一区| 337p日本欧洲亚洲大胆色噜噜| 精品国产一区二区三区久久久蜜月| 亚洲精品一区二区在线观看| 精品第一国产综合精品aⅴ| 欧美电影免费提供在线观看| 久久夜色精品一区| 亚洲国产精品精华液ab| 亚洲视频一二区| 亚洲伊人伊色伊影伊综合网| 日韩精品一二区| 国产一区二区按摩在线观看| 成人av网站免费| 色婷婷国产精品| 欧美久久久影院| 91精品国产欧美一区二区成人| 精品精品国产高清a毛片牛牛| 日本一区二区免费在线| 亚洲乱码一区二区三区在线观看| 亚洲一二三区视频在线观看| 免播放器亚洲一区| 久久电影网站中文字幕| 大胆欧美人体老妇| 在线免费亚洲电影| 欧美大片顶级少妇| 中文字幕制服丝袜一区二区三区| 亚洲国产日韩在线一区模特| 青娱乐精品视频在线| 处破女av一区二区| 欧美日韩一区二区三区不卡| 久久品道一品道久久精品| 亚洲精品成人悠悠色影视| 免费国产亚洲视频| 91在线看国产| 日韩午夜在线观看| 亚洲色图丝袜美腿| 精久久久久久久久久久| 91久久一区二区| 精品久久人人做人人爰| 亚洲精品va在线观看| 国产中文一区二区三区| 色成年激情久久综合| 26uuu另类欧美亚洲曰本| 亚洲精品欧美专区| 国产精品一区二区在线播放 | 99re成人精品视频| 日韩视频在线永久播放| 亚洲免费在线看| 久久99热狠狠色一区二区| 成人app下载| 精品日韩一区二区三区| 亚洲综合一二区| 国产91富婆露脸刺激对白| 欧美日韩电影在线| 亚洲欧美另类小说视频| 激情另类小说区图片区视频区| 91电影在线观看| 国产精品色哟哟网站| 久草在线在线精品观看| 欧美日韩亚洲高清一区二区| 亚洲欧洲精品一区二区三区| 激情综合一区二区三区| 91精品欧美一区二区三区综合在| 亚洲人妖av一区二区| 国产福利精品导航| 日韩欧美国产麻豆| 天堂成人免费av电影一区| 一本久久综合亚洲鲁鲁五月天| 国产亚洲午夜高清国产拍精品 | 欧美日韩亚洲综合在线| 中文字幕精品一区二区精品绿巨人 | 精品视频在线视频| 国产精品久久久久久亚洲伦| 韩国三级在线一区| 欧美一三区三区四区免费在线看| 亚洲永久精品国产| 91蜜桃免费观看视频| 中文欧美字幕免费| 豆国产96在线|亚洲| 久久精品综合网| 国产一本一道久久香蕉| 欧美岛国在线观看| 日本伊人色综合网| 欧美性感一类影片在线播放| 亚洲免费观看高清完整| 99热这里都是精品| 自拍偷拍国产精品| 91免费在线看| 亚洲女厕所小便bbb| 91视频观看视频| 亚洲男人的天堂在线aⅴ视频| 成人国产电影网| 亚洲欧洲精品一区二区三区| av一二三不卡影片| 亚洲免费成人av| 91国在线观看| 亚洲国产中文字幕在线视频综合 | 日韩视频中午一区| 精品影视av免费| 精品国产一二三| 国产大片一区二区| 中文字幕在线不卡一区二区三区| 丁香激情综合国产| 亚洲三级电影全部在线观看高清| 一本大道久久a久久综合婷婷| 亚洲综合精品自拍| 欧美二区乱c少妇| 精品一区二区在线观看| 国产亚洲精品aa| 99久久久无码国产精品| 亚洲一区在线观看免费| 精品污污网站免费看| 麻豆精品一区二区综合av| 国产午夜精品福利| 91在线无精精品入口| 亚洲午夜激情网站| 日韩欧美在线1卡| 国产精品系列在线观看| 亚洲欧洲制服丝袜| 51久久夜色精品国产麻豆| 在线观看亚洲一区| 蜜芽一区二区三区| 国产午夜精品在线观看| 91网站在线观看视频| 亚洲福利一区二区三区| 日韩精品专区在线影院重磅| 国产乱人伦偷精品视频不卡| 中文字幕日韩一区二区| 欧美亚日韩国产aⅴ精品中极品| 日韩精品一级二级| 久久久国产午夜精品| 91国产精品成人| 麻豆国产精品视频| 国产精品久久久久久久午夜片| 在线中文字幕不卡| 黑人精品欧美一区二区蜜桃 | 一区二区在线观看视频| 欧美一区二区国产| 成人精品高清在线| 日韩中文欧美在线| 国产精品久久午夜| 日韩一区二区三区在线| 91亚洲精华国产精华精华液| 日本不卡视频在线| 亚洲精品一二三区| 久久天天做天天爱综合色| 欧美视频三区在线播放| 粉嫩在线一区二区三区视频| 婷婷丁香激情综合| 自拍偷拍亚洲欧美日韩| 欧美变态tickling挠脚心| 在线免费不卡视频| 国产精品一二一区| 青娱乐精品在线视频| 亚洲人午夜精品天堂一二香蕉| 亚洲精品一区二区三区福利 | 欧美日韩国产精品成人| 成人高清视频免费观看| 久久精品国产色蜜蜜麻豆| 亚洲一区二区三区四区在线| 欧美国产精品v| 欧美成人伊人久久综合网| 91国偷自产一区二区三区观看| 国产精品自拍av| 蜜臀久久久久久久| 亚洲国产一区二区三区青草影视| 中文欧美字幕免费| 精品av久久707| 日韩一区二区在线看| 欧美偷拍一区二区| 久久综合网色—综合色88| 8v天堂国产在线一区二区| 色噜噜久久综合| 97精品国产97久久久久久久久久久久| 国产在线视频一区二区三区| 日本三级亚洲精品| 亚洲第一激情av| 一区二区三区成人| 亚洲欧洲国产日本综合| 亚洲国产成人一区二区三区| 精品成人一区二区三区四区| 日韩一区二区免费在线电影| 欧美日韩dvd在线观看| 欧美天天综合网| 欧美性大战久久久久久久| 91麻豆视频网站| 97se亚洲国产综合自在线观| av在线不卡网| 99在线精品免费|