/// <summary> /// Serialises all properties. The output will be a dictionary containing the /// objects properties in a form that can easily be converted to Json. /// </summary> /// /// <returns>The serialised object in dictionary form.</returns> public IDictionary <string, object> Serialise() { var dictionary = new Dictionary <string, object>(); // Key dictionary.Add("Key", Key); // Name dictionary.Add("Name", Name); // Tags var serialisedTags = JsonSerialisation.Serialise(Tags, (string element) => { return(element); }); dictionary.Add("Tags", serialisedTags); // Custom Data if (CustomData != null) { dictionary.Add("CustomData", CustomData.Serialise()); } // Costs dictionary.Add("Costs", Costs.Serialise()); // Rewards dictionary.Add("Rewards", Rewards.Serialise()); return(dictionary); }