private void _Save(PersistentObject PersistentObject) { if (PersistentObject != null) { if (_Objects.ContainsKey(PersistentObject) == false) { var Identifier = _Objects.Count.ToUInt32(); _Objects.Add(PersistentObject, new Pair <Boolean, ObjectReference>(false, new ObjectReference(Identifier))); } if (_Objects[PersistentObject].First == false) { _Objects[PersistentObject].First = true; var Element = _Document.CreateElement("object"); Element.Attributes.Append(_CreateAttribute("identifier", _GetIdentifier(PersistentObject).Identifier.ToString(_CultureInfo))); Element.Attributes.Append(_CreateTypeAttribute(PersistentObject.GetType())); var ObjectStore = new SaveObjectStore(this, Element); PersistentObject.Save(ObjectStore); Debug.Assert(_Document.DocumentElement != null); _Document.DocumentElement.AppendChild(Element); } } }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("computer", _Computer); ObjectStore.Save("janitor", _Janitor); ObjectStore.Save("office", _Office); ObjectStore.Save("person", _Person); ObjectStore.Save("rectangle", _Rectangle); ObjectStore.Save("trash-level", _TrashLevel); }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("bottom", _Bottom); ObjectStore.Save("height", _Height); ObjectStore.Save("left", _Left); ObjectStore.Save("minutes-until-broken", _MinutesUntilBroken); ObjectStore.Save("office", _Office); ObjectStore.Save("width", _Width); }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("background-color", _BackgroundColor); ObjectStore.Save("border-color", _BorderColor); ObjectStore.Save("floor", _Floor); ObjectStore.Save("height", _Height); ObjectStore.Save("left", _Left); ObjectStore.Save("width", _Width); }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("background-color", _BackgroundColor); ObjectStore.Save("border-color", _BorderColor); ObjectStore.Save("height", _Height); ObjectStore.Save("office", _Office); ObjectStore.Save("width", _Width); ObjectStore.Save("x", _X); ObjectStore.Save("y", _Y); }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("cat", Cat); ObjectStore.Save("first-desk", FirstDesk); ObjectStore.Save("first-lamp", FirstLamp); ObjectStore.Save("fourth-desk", FourthDesk); ObjectStore.Save("second-desk", SecondDesk); ObjectStore.Save("second-lamp", SecondLamp); ObjectStore.Save("third-desk", ThirdDesk); ObjectStore.Save("third-lamp", ThirdLamp); }
public override void Save(SaveObjectStore ObjectStore) { ObjectStore.Save("broken-things", _BrokenThings); ObjectStore.Save("buildings", _Buildings); ObjectStore.Save("cat-stock", _CatStock); ObjectStore.Save("cents", _Cents); ObjectStore.Save("highest-floor", _HighestFloor); ObjectStore.Save("left-border", _LeftBorder); ObjectStore.Save("lowest-floor", _LowestFloor); ObjectStore.Save("minutes", _Minutes); ObjectStore.Save("next-cat-at-number-of-employees", _NextCatAtNumberOfEmployees); ObjectStore.Save("persons", _Persons); ObjectStore.Save("right-border", _RightBorder); }
public void SaveContained(String PropertyName, Object Value) { if (Value is PersistentObject) { throw new Exception("Cannot store contained persistent objects."); } else if (Value is IPersistable) { var ChildElement = _GameSaver.CreateChildElement(_Element, PropertyName, Value.GetType()); var ObjectStore = new SaveObjectStore(_GameSaver, ChildElement); (Value as IPersistable).Save(ObjectStore); } }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("action-fraction", _ActionFraction); ObjectStore.Save("animation-fraction", _AnimationFraction); ObjectStore.Save("animation-state", _AnimationState); ObjectStore.Save("arrives-at-minute", _ArrivesAtMinute); ObjectStore.Save("arrives-at-minute-of-day", _ArrivesAtMinuteOfDay); ObjectStore.Save("at-desk", _AtDesk); ObjectStore.Save("background-color", _BackgroundColor); ObjectStore.Save("border-color", _BorderColor); ObjectStore.Save("desk", _Desk); ObjectStore.Save("height", _Height); ObjectStore.Save("leaves-at-minute", _LeavesAtMinute); ObjectStore.Save("living-side", _LivingSide); ObjectStore.Save("name", _Name); ObjectStore.Save("wage", _Wage); ObjectStore.Save("width", _Width); ObjectStore.Save("work-minutes", _WorkMinutes); ObjectStore.Save("x", _X); ObjectStore.Save("y", _Y); }
public void Save(SaveObjectStore ObjectStore) { ObjectStore.Save("x", X); ObjectStore.Save("y", Y); }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("bonus-promille", _BonusPromille); }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("repairing-target", _RepairingTarget); }
public override void Save(SaveObjectStore ObjectStore) { ObjectStore.Save("minutes-until-broken", _MinutesUntilBroken); ObjectStore.Save("rectangle", _Rectangle); }
public override void Save(SaveObjectStore ObjectStore) { base.Save(ObjectStore); ObjectStore.Save("cleaning-targets", _CleaningTargets); }