本文整理汇总了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));
}
}
示例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
};
}
示例3: MetadataOf
private static BattleItemMetadata MetadataOf(WeaponType weaponType) => weaponType.Metadata();