From 0e180b0ad30d5f468be1c239865688449b8747cc Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 10 Nov 2008 20:04:55 +0000 Subject: * refactor: Expose SOG.SetRootPart for outsiders to use rather than setting RootPart and adding the part separately * Make RootPart read only --- OpenSim/Data/MSSQL/MSSQLRegionData.cs | 4 ++-- OpenSim/Data/MySQL/MySQLRegionData.cs | 4 ++-- OpenSim/Data/NHibernate/NHibernateRegionData.cs | 6 ++---- OpenSim/Data/SQLite/SQLiteRegionData.cs | 7 +++---- OpenSim/Data/Tests/BasicRegionTest.cs | 6 ++---- 5 files changed, 11 insertions(+), 16 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 6f4edd1..3669bdc 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs @@ -210,8 +210,8 @@ namespace OpenSim.Data.MSSQL "No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } - group.AddPart(prim); - group.RootPart = prim; + + group.SetRootPart(prim); createdObjects.Add(group.UUID, group); retvals.Add(group); diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index 27bfec8..70940db 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -421,8 +421,8 @@ namespace OpenSim.Data.MySQL "No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } - group.AddPart(prim); - group.RootPart = prim; + + group.SetRootPart(prim); createdObjects.Add(group.UUID, group); retvals.Add(group); LoadItems(prim); diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index ecb29fe..833f1b7 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs @@ -195,8 +195,7 @@ namespace OpenSim.Data.NHibernate // root part if (p.UUID == uuid) { - group.AddPart(p); - group.RootPart = p; + group.SetRootPart(p); } else { @@ -244,8 +243,7 @@ namespace OpenSim.Data.NHibernate if (p.UUID == p.ParentUUID) { SceneObjectGroup group = new SceneObjectGroup(); - group.AddPart(p); - group.RootPart = p; + group.SetRootPart(p); SOG.Add(p.ParentUUID, group); } else diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 93d9406..cc3ad06 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -436,8 +436,8 @@ namespace OpenSim.Data.SQLite "[REGION DB]: No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } - group.AddPart(prim); - group.RootPart = prim; + + group.SetRootPart(prim); createdObjects.Add(group.UUID, group); retvals.Add(group); LoadItems(prim); @@ -1102,8 +1102,7 @@ namespace OpenSim.Data.SQLite // sop.TouchName = ""; // sop.UUID = UUID.Random(); // sop.Shape = PrimitiveBaseShape.Default; - // sog.AddPart(sop); - // sog.RootPart = sop; + // sog.SetRootPart(sop); // Add breakpoint in above line. Check sop fields. // TODO: this doesn't work yet because something more diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index 12435c9..ab46ed4 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs @@ -315,8 +315,7 @@ namespace OpenSim.Data.Tests sop.ObjectFlags = 0; SceneObjectGroup sog = new SceneObjectGroup(); - sog.AddPart(sop); - sog.RootPart = sop; + sog.SetRootPart(sop); // Inserts group in DB db.StoreObject(sog,region3); @@ -795,8 +794,7 @@ namespace OpenSim.Data.Tests sop.Shape = PrimitiveBaseShape.Default; SceneObjectGroup sog = new SceneObjectGroup(); - sog.AddPart(sop); - sog.RootPart = sop; + sog.SetRootPart(sop); return sog; } -- cgit v1.1