本文整理汇总了C#中Equipment.GetSize方法的典型用法代码示例。如果您正苦于以下问题:C# Equipment.GetSize方法的具体用法?C# Equipment.GetSize怎么用?C# Equipment.GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Equipment
的用法示例。
在下文中一共展示了Equipment.GetSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSpaceUsed
private float GetSpaceUsed(Technology whichTech, bool useSecondary)
{
Equipment equipment = new Equipment(whichTech, useSecondary);
return equipment.GetSize(_techLevels, _shipDesign.Size) + equipment.GetPower(_shipDesign.Size) * _spacePerPower;
}
示例2: AtLeastOneHigherLevelSpecial
private bool AtLeastOneHigherLevelSpecial(Equipment special, float remainingSpace)
{
float currentSpecialSpaceUsage = 0;
int index = -1;
if (special != null)
{
currentSpecialSpaceUsage = special.GetSize(_techLevels, _shipDesign.Size);
index = _availableSpecialTechs.IndexOf(special.Technology);
}
float totalAvailableSpace = currentSpecialSpaceUsage + remainingSpace;
for (int i = index + 1; i < _availableSpecialTechs.Count; i++)
{
if (GetSpaceUsed(_availableSpecialTechs[i], false) <= totalAvailableSpace)
{
return true;
}
}
return false;
}
示例3: AtLeastOneBetterEngine
private bool AtLeastOneBetterEngine(float remainingSpace)
{
if (_shipDesign.Engine.Key.Technology == _availableEngineTechs[_availableEngineTechs.Count - 1])
{
//Already the best engine
return false;
}
int index = _availableEngineTechs.IndexOf(_shipDesign.Engine.Key.Technology) + 1; //Just one level higher will suffice
Equipment engine = new Equipment(_availableEngineTechs[index], false);
float totalSpace = (engine.GetSize(_techLevels, _shipDesign.Size) / (engine.Technology.Speed * 10)) * _shipDesign.PowerUsed;
return totalSpace <= remainingSpace;
}
示例4: AtLeastOneBetterWeapon
private bool AtLeastOneBetterWeapon(KeyValuePair<Equipment, int> weapon, float remainingSpace)
{
float currentWeaponSpaceUsage = 0;
int index = -1;
if (weapon.Key != null)
{
currentWeaponSpaceUsage = weapon.Key.GetSize(_techLevels, _shipDesign.Size) * weapon.Value;
index = _availableWeaponTechs.IndexOf(weapon.Key.Technology);
}
float totalAvailableSpace = remainingSpace + currentWeaponSpaceUsage;
if (weapon.Key != null && !weapon.Key.UseSecondary && weapon.Key.Technology.MaximumSecondaryWeaponDamage > 0)
{
//There is a bigger version of the weapon, see if there's room for it
Equipment bigWeapon = new Equipment(weapon.Key.Technology, true);
if (bigWeapon.GetSize(_techLevels, _shipDesign.Size) <= totalAvailableSpace)
{
return true;
}
}
for (int i = index + 1; i < _availableWeaponTechs.Count; i++)
{
if (GetSpaceUsed(_availableWeaponTechs[i], false) <= totalAvailableSpace)
{
return true;
}
}
return false;
}
示例5: AtLeastOneBetterArmor
private bool AtLeastOneBetterArmor(float remainingSpace)
{
if (_shipDesign.Armor.Technology == _availableArmorTechs[_availableArmorTechs.Count - 1])
{
if (_shipDesign.Armor.UseSecondary)
{
//Already the best armor with double hull
return false;
}
Equipment armor = new Equipment(_shipDesign.Armor.Technology, true);
return armor.GetSize(_techLevels, _shipDesign.Size) <= remainingSpace;
}
int index = _availableArmorTechs.IndexOf(_shipDesign.Armor.Technology) + 1; //Just one level higher will suffice
return GetSpaceUsed(_availableArmorTechs[index], false) <= remainingSpace;
}