diff --git a/GeneralMods/HappyBirthday/Framework/Events/Preconditions/LocationPrecondition.cs b/GeneralMods/HappyBirthday/Framework/Events/Preconditions/LocationPrecondition.cs new file mode 100644 index 00000000..c69d011a --- /dev/null +++ b/GeneralMods/HappyBirthday/Framework/Events/Preconditions/LocationPrecondition.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using StardewValley; + +namespace Omegasis.HappyBirthday.Framework.Events.Preconditions +{ + public class LocationPrecondition:EventPrecondition + { + private string locationName; + private GameLocation location; + + + public LocationPrecondition() + { + + } + + public LocationPrecondition(GameLocation Location) + { + this.locationName = Location.NameOrUniqueName; + this.location = Location; + } + + /// + /// Constructor. + /// + /// The name of the location. + /// The location is a building on the farm. + public LocationPrecondition(string Location, bool IsStructure=false) + { + this.locationName = Location; + this.location = Game1.getLocationFromName(Location,IsStructure); + } + + public override bool meetsCondition() + { + return Game1.player.currentLocation == this.location; + } + } +}