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


C# WeaponType.Metadata方法代码示例

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


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

示例1: AddTopicControls

		private void AddTopicControls(WeaponType weapon)
		{
			var metadata = weapon.Metadata();
			AddControl(new Item(4 + 8 * (3 - metadata.Height), 158 + 8 * (2 - metadata.Width), metadata.Image));
			AddControl(new Label(24, 5, metadata.Name, Font.Large, ColorScheme.White));

			AddControl(new Label(7, 224, "DAMAGE", Font.Normal, ColorScheme.White));
			AddControl(new Label(7, 285, "AMMO", Font.Normal, ColorScheme.White));

			var nextTop = 24;
			var ammoLeft = Label.CenterOf(195, 90);
			var laserWeapon = EnumEx.GetValues<LaserWeaponType>()
				.Where(laserWeaponType => laserWeaponType.Metadata().Weapon == weapon)
				.Cast<LaserWeaponType?>()
				.SingleOrDefault();
			if (laserWeapon != null)
			{
				AddControl(new Label(nextTop, ammoLeft, DamageType.LaserBeam.Metadata().Name, Font.Normal, ColorScheme.White));
				AddControl(new Label(nextTop + 16, ammoLeft, laserWeapon.Value.Metadata().Damage.FormatNumber(), Font.Large, ColorScheme.Red));
			}
			else
			{
				foreach (var ammunition in metadata.SupportedAmmunition)
				{
					var ammoMetadata = ammunition.Metadata();
					var top = nextTop;
					nextTop += 49;
					AddControl(new Label(top, ammoLeft, ammoMetadata.DamageType.Metadata().Name, Font.Normal, ColorScheme.White));
					AddControl(new Label(top + 16, ammoLeft, ammoMetadata.Damage.FormatNumber(), Font.Large, ColorScheme.Red));
					AddControl(new Item(
						top - 7 + 8 * (3 - ammoMetadata.Height),
						283 + 8 * (2 - ammoMetadata.Width),
						ammoMetadata.Image));
				}
			}

			AddControl(new Label(67, 8, "SHOT TYPE>", Font.Normal, ColorScheme.White));
			AddControl(new Label(67, 80, "ACCURACY>", Font.Normal, ColorScheme.White));
			AddControl(new Label(67, 152, "TU COST>", Font.Normal, ColorScheme.White));

			nextTop = 82;
			foreach (var shot in metadata.Shots)
			{
				var top = nextTop;
				nextTop += 20;
				AddControl(new Label(top, 8, shot.ShotType.Metadata().Name, Font.Large, ColorScheme.White));
				AddControl(new Label(top, 88, $"{shot.Accuracy.FormatNumber()}\t%", Font.Large, ColorScheme.LightBlue));
				AddControl(new Label(top, 144, $"{shot.TimeUnits.FormatNumber()}\t%", Font.Large, ColorScheme.LightBlue));
			}

			nextTop = 138;
			foreach (var descriptionLine in metadata.DescriptionLines)
			{
				var top = nextTop;
				nextTop += 8;
				AddControl(new Label(top, 8, descriptionLine, Font.Normal, ColorScheme.White));
			}
		}
开发者ID:jmfb,项目名称:XComGenerations,代码行数:58,代码来源:TopicView.cs

示例2: Weapon

 private static TopicMetadata Weapon(WeaponType weapon, params ResearchType[] requiredResearch)
 {
     return new TopicMetadata
     {
         Name = weapon.Metadata().Name,
         Category = TopicCategory.WeaponsAndEquipment,
         Background = Backgrounds.InfoItem,
         BackgroundPalette = 4,
         Scheme = ColorScheme.Yellow,
         RequiredResearch = requiredResearch,
         Subject = weapon
     };
 }
开发者ID:jmfb,项目名称:XComGenerations,代码行数:13,代码来源:TopicType.cs

示例3: MetadataOf

		private static BattleItemMetadata MetadataOf(WeaponType weaponType) => weaponType.Metadata();
开发者ID:jmfb,项目名称:XComGenerations,代码行数:1,代码来源:BattleItem.cs


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