Added in code to get the sdv event from the event helper.

This commit is contained in:
JoshuaNavarro 2019-12-04 01:08:29 -08:00
parent ac5e291492
commit b5b6f500f9
1 changed files with 19 additions and 2 deletions

View File

@ -43,15 +43,17 @@ namespace Omegasis.HappyBirthday.Framework.Events
private StringBuilder eventData; private StringBuilder eventData;
public int eventID;
public EventHelper() public EventHelper()
{ {
} }
public EventHelper(TimePrecondition Time, EventDayExclusionPrecondition NotTheseDays) public EventHelper(int ID,TimePrecondition Time, EventDayExclusionPrecondition NotTheseDays)
{ {
this.eventData = new StringBuilder(); this.eventData = new StringBuilder();
this.eventID = ID;
this.add(Time); this.add(Time);
this.add(NotTheseDays); this.add(NotTheseDays);
@ -140,6 +142,11 @@ namespace Omegasis.HappyBirthday.Framework.Events
return s.Substring(0, 4); return s.Substring(0, 4);
} }
private string getEventID()
{
return this.getUniqueEventStartID() + this.eventID.ToString();
}
/// <summary> /// <summary>
/// Checks to ensure I don't create a id value that is too big for nexus. /// Checks to ensure I don't create a id value that is too big for nexus.
/// </summary> /// </summary>
@ -161,5 +168,15 @@ namespace Omegasis.HappyBirthday.Framework.Events
if (Convert.ToInt32(IDToCheck) > 2147483647 ||Convert.ToInt32(IDToCheck) < 0) return false; if (Convert.ToInt32(IDToCheck) > 2147483647 ||Convert.ToInt32(IDToCheck) < 0) return false;
else return true; else return true;
} }
public virtual string getEventString()
{
return this.eventData.ToString();
}
public virtual StardewValley.Event getEvent(Farmer PlayerActor=null)
{
return new StardewValley.Event(this.getEventString(), Convert.ToInt32(this.getEventID()), PlayerActor);
}
} }
} }