using Microsoft.Xna.Framework;
using TouchyTickets.Attractions;

namespace TouchyTickets.Upgrades; 

public class ModifierUpgrade : Upgrade {

    private readonly AttractionFlags requiredFlag;
    private readonly float modifier;

    public ModifierUpgrade(string name, int price, Point texture, AttractionFlags requiredFlag, float modifier, params Upgrade[] dependencies) :
        base(name, price, texture, dependencies) {
        this.requiredFlag = requiredFlag;
        this.modifier = modifier;
    }

    public float GetCurrentMultiplier(AttractionType attraction) {
        if (this.IsActive() && attraction.Flags.HasFlag(this.requiredFlag))
            return this.modifier;
        return 1;
    }

}