protected void CalculateStats() { var shipUpgradeShipStats = Inventory.Items .Where(i => i.Data.ItemType == ItemType.ShipUpgrade) .Select(i => ((ShipUpgradeItemData)i.Data).ShipStats); int newHealth = 0; int newShield = 0; int newDamage = 0; int newEnergy = 0; int newEnergyRegen = 0; foreach (ShipStats stats in shipUpgradeShipStats) { newHealth += stats.Health; newShield += stats.Shield; newDamage += stats.Damage; newEnergy += stats.Energy; newEnergyRegen += stats.EnergyRegen; } modifiedStats = new ShipStats(newHealth, newShield, newDamage, newEnergy, newEnergyRegen); }
public PlayerShip(Transform transform, Texture2D sprite, ShipStats baseStats) : base(transform, sprite, baseStats) { }