using System; using System.Collections.Generic; using Newtonsoft.Json; namespace RhythmHeavenMania { [Serializable] public class Beatmap { public float bpm; public List entities = new List(); public List tempoChanges = new List(); [Serializable] public class Entity : ICloneable { public float beat; public int track; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float length; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valA; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type; public string datamodel; [JsonIgnore] public Editor.Track.TimelineEventObj eventObj; public object Clone() { return this.MemberwiseClone(); } public object this[string propertyName] { get { return typeof(Entity).GetField(propertyName).GetValue(this); } set { try { typeof(Entity).GetField(propertyName).SetValue(this, value); } catch (Exception ex) { UnityEngine.Debug.LogError($"You probably misspelled a paramater, or defined the object type wrong. Exception log: {ex}"); } } } } [Serializable] public class TempoChange : ICloneable { public float beat; public float length; public float tempo; public object Clone() { return this.MemberwiseClone(); } } } }