本文整理汇总了C#中ItemType.Metadata方法的典型用法代码示例。如果您正苦于以下问题:C# ItemType.Metadata方法的具体用法?C# ItemType.Metadata怎么用?C# ItemType.Metadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemType
的用法示例。
在下文中一共展示了ItemType.Metadata方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetColor
private ColorScheme GetColor(ItemType item)
{
if (craft.Stores[item] > 0)
return ColorScheme.White;
var isAmmo = item.Metadata().AmmoForWeapon != null;
return isAmmo ? ColorScheme.Purple : ColorScheme.Blue;
}
示例2: CreateCostRow
private void CreateCostRow(int topRow, ItemType itemType, int quantity)
{
var metadata = itemType.Metadata();
AddControl(new ExtendedLabel(topRow, 10, 125, metadata.Name, Font.Normal, ColorScheme.Blue));
AddControl(new ExtendedLabel(topRow, 135, 70, $"${metadata.MonthlyCost.FormatNumber()}", Font.Normal, ColorScheme.Blue));
AddControl(new ExtendedLabel(topRow, 205, 45, quantity.FormatNumber(), Font.Normal, ColorScheme.Blue));
AddControl(new Label(topRow, 250, $"${(metadata.MonthlyCost * quantity).FormatNumber()}", Font.Normal, ColorScheme.Blue));
}
示例3: NotEnoughStoresToRearmCraft
public NotEnoughStoresToRearmCraft(Data.Base @base, Craft craft, ItemType ammo)
{
AddControl(new Border(20, 32, 256, 160, ColorScheme.Green, Backgrounds.Craft, 10));
AddControl(new Label(66, Label.Center, "Not enough", Font.Large, ColorScheme.Green));
AddControl(new Label(82, Label.Center, ammo.Metadata().Name, Font.Large, ColorScheme.Green));
AddControl(new Label(98, Label.Center, $"to rearm {craft.Name}", Font.Large, ColorScheme.Green));
AddControl(new Label(114, Label.Center, $"at {@base.Name}", Font.Large, ColorScheme.Green));
AddControl(new Button(150, 48, 100, 16, "OK", ColorScheme.Green, Font.Normal, EndModal));
AddControl(new Button(150, 172, 100, 16, "OK - 5 secs", ColorScheme.Green, Font.Normal, OnOkFiveSeconds));
}
示例4: OnIncreaseItem
private void OnIncreaseItem(ItemType item)
{
if (GameState.SelectedBase.Stores[item] == 0)
return;
var hwpSpace = item.Metadata().HwpSpace;
if (hwpSpace > craft.HwpSpaceAvailable || hwpSpace * 4 > craft.SpaceAvailable)
return;
if (craft.TotalItemCount == 80)
{
AbortEquipItem();
new NoMoreEquipmentAllowed().DoModal(this);
return;
}
GameState.SelectedBase.Stores.Remove(item);
craft.Stores.Add(item);
}
示例5: OnDecreaseItem
private void OnDecreaseItem(ItemType item)
{
if (craft.Stores[item] == 0)
return;
if (item.Metadata().StorageSpace > GameState.SelectedBase.ItemSpaceAvailable)
{
AbortEquipItem();
new NotEnoughStoreSpace(ColorScheme.LightMagenta, Backgrounds.Battle, 8).DoModal(this);
return;
}
craft.Stores.Remove(item);
GameState.SelectedBase.Stores.Add(item);
}
示例6: GetName
private static string GetName(ItemType item)
{
var metadata = item.Metadata();
var isAmmo = metadata.AmmoForWeapon != null;
return isAmmo ? $" \t{metadata.Name}" : metadata.Name;
}
示例7: GetMonthlyCost
private static int GetMonthlyCost(ItemType itemType, int count) => itemType.Metadata().MonthlyCost * count;