Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public IkonBaseObject Serialize(object originalObject, SaveSession session)
 {
     return(session.Serialize(this.getter(originalObject)));
 }
Ejemplo n.º 5
0
 private IkonBaseObject serializeChildren <T>(T[] originalArray, SaveSession session)
 {
     return(new IkonArray(originalArray.Select(x => session.Serialize(x))));
 }