protected BaseMapObject(long id) { ID = id; Data = new MapObjectDataCollection(); Hierarchy = new MapObjectHierarchy(this); BoundingBox = Box.Empty; }
protected BaseMapObject(SerialisedObject obj) { if (SerialisedName != obj.Name) { throw new Exception($"Tried to deserialise a {obj.Name} into a {SerialisedName}."); } ID = obj.Get <long>("ID"); IsSelected = obj.Get <bool>("IsSelected"); Data = new MapObjectDataCollection(); Hierarchy = new MapObjectHierarchy(this); BoundingBox = Box.Empty; SetCustomSerialisedData(obj); }