diff options
author | Adam Frisby | 2008-11-16 04:40:36 +0000 |
---|---|---|
committer | Adam Frisby | 2008-11-16 04:40:36 +0000 |
commit | 29eec3350649f377e61d144d73178c67757070ba (patch) | |
tree | 7e790e27b5730b07daeab89698d99eec4e83d4fb /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |
parent | Make a quick stab at the "Open data reader" issue. (diff) | |
download | opensim-SC-29eec3350649f377e61d144d73178c67757070ba.zip opensim-SC-29eec3350649f377e61d144d73178c67757070ba.tar.gz opensim-SC-29eec3350649f377e61d144d73178c67757070ba.tar.bz2 opensim-SC-29eec3350649f377e61d144d73178c67757070ba.tar.xz |
* Abstracted some methods from SceneObjectGroup to allow them to be overridden more easily. Specifically object creation from XML.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index acb6888..0af2ad2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -473,6 +473,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
473 | /// </summary> | 473 | /// </summary> |
474 | public SceneObjectGroup(string xmlData) | 474 | public SceneObjectGroup(string xmlData) |
475 | { | 475 | { |
476 | SetFromXml(xmlData); | ||
477 | } | ||
478 | |||
479 | protected void SetFromXml(string xmlData) | ||
480 | { | ||
476 | // libomv.types changes UUID to Guid | 481 | // libomv.types changes UUID to Guid |
477 | xmlData = xmlData.Replace("<UUID>", "<Guid>"); | 482 | xmlData = xmlData.Replace("<UUID>", "<Guid>"); |
478 | xmlData = xmlData.Replace("</UUID>", "</Guid>"); | 483 | xmlData = xmlData.Replace("</UUID>", "</Guid>"); |
@@ -486,7 +491,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
486 | reader.Read(); | 491 | reader.Read(); |
487 | 492 | ||
488 | reader.ReadStartElement("SceneObjectGroup"); | 493 | reader.ReadStartElement("SceneObjectGroup"); |
489 | SetRootPart(SceneObjectPart.FromXml(reader)); | 494 | SetRootPart(CreatePartFromXml(reader)); |
490 | 495 | ||
491 | reader.Read(); | 496 | reader.Read(); |
492 | bool more = true; | 497 | bool more = true; |
@@ -498,7 +503,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
498 | case XmlNodeType.Element: | 503 | case XmlNodeType.Element: |
499 | if (reader.Name == "SceneObjectPart") | 504 | if (reader.Name == "SceneObjectPart") |
500 | { | 505 | { |
501 | SceneObjectPart part = SceneObjectPart.FromXml(reader); | 506 | SceneObjectPart part = CreatePartFromXml(reader); |
502 | AddPart(part); | 507 | AddPart(part); |
503 | part.StoreUndoState(); | 508 | part.StoreUndoState(); |
504 | } | 509 | } |
@@ -519,6 +524,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
519 | sr.Close(); | 524 | sr.Close(); |
520 | } | 525 | } |
521 | 526 | ||
527 | protected virtual SceneObjectPart CreatePartFromXml(XmlTextReader reader) | ||
528 | { | ||
529 | SceneObjectPart part = SceneObjectPart.FromXml(reader); | ||
530 | return part; | ||
531 | } | ||
532 | |||
522 | /// <summary> | 533 | /// <summary> |
523 | /// Constructor. This object is added to the scene later via AttachToScene() | 534 | /// Constructor. This object is added to the scene later via AttachToScene() |
524 | /// </summary> | 535 | /// </summary> |