Esempio n. 1
0
    ///<summary>
    ///Recalculates the specified stat based on the current modifiers.
    ///</summary>
    private void RecalculateStat(ModifiableStat stat)
    {
        float multiplier, delta;

        _modifiers.Get(stat, out multiplier, out delta);

        switch (stat)
        {
        case ModifiableStat.ComputerResources:
            computer.SetTotalCpu(delta, multiplier);
            break;

        case ModifiableStat.EnergyRecharge:
            power.SetEnergyRecharge(delta, multiplier);
            break;

        case ModifiableStat.EnergyCapacity:
            power.SetEnergyCapacity(delta, multiplier);
            break;

        case ModifiableStat.Mass:
            mass.added    = (int)delta;
            mass.modifier = multiplier;
            break;

        default:
            break;
        }

        // TODO Implement the OverclockDamage modifier.
    }