private IkonBaseObject serializeChildren <K, V>(IDictionary <K, V> originalDictionary, SaveSession session) { var data = new IkonArray(); foreach (var element in originalDictionary) { data.Add(session.Serialize(element.Key)); data.Add(session.Serialize(element.Value)); } return(data); }
private IkonBaseObject serializeChildren <T>(ICollection <T> originalCollection, SaveSession session) { var data = new IkonArray(); foreach (var element in originalCollection) { data.Add(session.Serialize(element)); } return(data); }
public IkonBaseObject Save(object obj) { var session = new SaveSession(getTypeStrategy); var mainData = session.Serialize(obj); var referencedData = session.GetSerialzedData(); var result = new IkonComposite(MainGame.SaveGameTag); result.Add("references", new IkonArray(referencedData)); result.Add(EntryPointKey, mainData); return(result); }
public IkonBaseObject Serialize(object originalObject, SaveSession session) { return(session.Serialize(this.getter(originalObject))); }
private IkonBaseObject serializeChildren <T>(T[] originalArray, SaveSession session) { return(new IkonArray(originalArray.Select(x => session.Serialize(x)))); }