using Ripple_Data.Base; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Ripple_Data.Control; using Ripple_Data.Control.Commands; using System.Runtime.Serialization; using MoonSharp.Interpreter; namespace Ripple_Data.Quests { [MoonSharpUserData] [Serializable] public class Quest : Ripple, IIdentifyable { public List<Objective> Objectives { get; private set; } public new int ID { get; private set; } public new IIdentifyable Self { get; private set; } public new List<GameRule> Rules { get; set; } public new List<Condition> Conditions { get; set; } public Quest(string Name, List<Objective> Objectives, List<GameRule> gameRules, List<Condition> conditions, string? Description = null) : base(Name, Description) { this.Objectives = Objectives; this.ID = GiveID(this); this.Self = this; this.Rules = gameRules; this.Conditions = conditions; GetInstance(this).Objects.Add(this); } public Quest() { ID = 0; Self = this; Rules = new List<GameRule>(); Conditions = new List<Condition>(); Objectives = new List<Objective>(); } public new void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("Name", Name); info.AddValue("ID", ID); info.AddValue("Description", Description); info.AddValue("Objectives", Objectives); info.AddValue("Rules", Rules); info.AddValue("Conditions", Conditions); } } }