当前位置: 首页>>代码示例>>C#>>正文


C# Form1.openCityFrm方法代码示例

本文整理汇总了C#中System.Form1.openCityFrm方法的典型用法代码示例。如果您正苦于以下问题:C# Form1.openCityFrm方法的具体用法?C# Form1.openCityFrm怎么用?C# Form1.openCityFrm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Form1的用法示例。


在下文中一共展示了Form1.openCityFrm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: buildConstruction

		public void buildConstruction( Form1 form1 ) // Building( Stat.Building building )
		{
			bool keepGoing = true;
			if ( 
				population == 1 && 
				construction.list[ 0 ] == Statistics.units[ (byte)Form1.unitType.colon ]
				)
			{
				if ( player.player == player.game.curPlayerInd )
				{
					Stat.Construction[] ib = ai.whatCanBeBuilt(
						player.player, 
						city 
						);
					string[] choices = uiWrap.buildingListStrings( player.player, city, ib ); 
											
					form1.zoomOnCity( player.player, city );

					userChoice ui = new userChoice(
						language.getAString( language.order.uiNewConstrution ),
						String.Format( language.getAString( language.order.uiNewConstrution ), name ),
						choices,
						0,
						language.getAString( language.order.ok ),
						language.getAString( language.order.uiGoToCity )
						);
					ui.ShowDialog();
					int res = ui.result;

					if ( res == -1 )
					{
						form1.openCityFrm( player.player, city );
						keepGoing = false;
					}
					else if ( res == 0 )
					{
						keepGoing = true;
						/*		construction.points -= Statistics.units[ construction.list[ 0 ].ind ].cost;
								Form1.game.curPlayer.createUnit ( X, Y, (byte)construction.list[ 0 ].ind );
								Form1.game.curPlayerInd.cityList[ i ].kill();
								continue;*/
					}
					else
					{ // si non
						construction.list[0] = ib[res];
						keepGoing = false;
						/*		Form1.construction.list[ 0 ].ind = ib[ res ].info;
								Form1.construction.list[ 0 ].type = ib[ res ].type;*/
					}
				}
				else
					ai.chooseConstruction( player.player, city );
			}
		//	else

			if ( keepGoing )
			{
				construction.points -= construction.list[ 0 ].cost; //Statistics.units[ construction.list[ 0 ].ind ].cost;
												
				if ( construction.list[ 0 ] is Stat.Unit ) // construction.list[ 0 ].type == 1 )
				{ // units
					player.createUnit( X, Y, (byte)construction.list[ 0 ].type );
												
					if ( construction.list[ 0 ] == Statistics.units[ (byte)Form1.unitType.colon ] ) //construction.list[ 0 ].ind == (byte)Form1.unitType.colon )
					{
						if ( population > 1 )
						{
							labor.autoRemoveLabor( player.player, city, true );
							population --;
						}
						else
						{
							kill();
						}
					}
				}
				else if ( construction.list[ 0 ] is Stat.Building )
				{ // buildings
					buildingList[ construction.list[ 0 ].type ] = true;
					aiPref.setBuildingUpkeep( player.player );

					#region special buildings
					#endregion
				}
				else if ( construction.list[ 0 ] is Stat.SmallWonder )
				{ // buildings
				//	buildingList[ construction.list[ 0 ].type ] = true;
				///	aiPref.setBuildingUpkeep( player.player );
				
					player.smallWonderList.buildWonder( construction.list[ 0 ] );

					#region special
					#endregion
				}
				else if ( construction.list[ 0 ] is Stat.Wonder )
				{ // buildings
				//	buildingList[ construction.list[ 0 ].type ] = true;
				//	aiPref.setBuildingUpkeep( player.player );
					
					player.game.wonderList.buildWonder( construction.list[ 0 ] );
//.........这里部分代码省略.........
开发者ID:jithuin,项目名称:infogeezer,代码行数:101,代码来源:CityList.cs


注:本文中的System.Form1.openCityFrm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。