From 84c3a317c12984155a3ca6430c8804a348112dae Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 14 Jan 2008 22:37:45 +0000 Subject: [PATCH] Set svn:eol-style. --- .../Data.MySQL/MySQLDatabaseMapper.cs | 48 +-- OpenSim/Framework/Data/OpenSimDataReader.cs | 78 ++--- .../Framework/Data/OpenSimDatabaseMapper.cs | 46 +-- .../Data/OpenSimObjectFieldMapper.cs | 146 ++++----- .../Data/PrimitiveBaseShapeTableMapper.cs | 284 +++++++++--------- 5 files changed, 301 insertions(+), 301 deletions(-) diff --git a/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs b/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs index 1514f008fa..6b23c74e8f 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLDatabaseMapper.cs @@ -1,24 +1,24 @@ -using System.Data.Common; -using MySql.Data.MySqlClient; - -namespace OpenSim.Framework.Data.MySQL -{ - public class MySQLDatabaseMapper : OpenSimDatabaseMapper - { - public MySQLDatabaseMapper(string connectionString) - : base(connectionString) - { - } - - public override DbConnection GetNewConnection() - { - MySqlConnection connection = new MySqlConnection(m_connectionString); - return connection; - } - - public override string CreateParamName(string fieldName) - { - return "?" + fieldName; - } - } -} +using System.Data.Common; +using MySql.Data.MySqlClient; + +namespace OpenSim.Framework.Data.MySQL +{ + public class MySQLDatabaseMapper : OpenSimDatabaseMapper + { + public MySQLDatabaseMapper(string connectionString) + : base(connectionString) + { + } + + public override DbConnection GetNewConnection() + { + MySqlConnection connection = new MySqlConnection(m_connectionString); + return connection; + } + + public override string CreateParamName(string fieldName) + { + return "?" + fieldName; + } + } +} diff --git a/OpenSim/Framework/Data/OpenSimDataReader.cs b/OpenSim/Framework/Data/OpenSimDataReader.cs index 225df600f5..11a8b8bd46 100644 --- a/OpenSim/Framework/Data/OpenSimDataReader.cs +++ b/OpenSim/Framework/Data/OpenSimDataReader.cs @@ -1,39 +1,39 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Text; -using libsecondlife; -using TribalMedia.Framework.Data; - -namespace OpenSim.Framework.Data -{ - public class OpenSimDataReader : DataReader - { - public OpenSimDataReader(IDataReader source) : base(source) - { - } - - public LLVector3 GetVector(string s) - { - float x = GetFloat(s + "X"); - float y = GetFloat(s + "Y"); - float z = GetFloat(s + "Z"); - - LLVector3 vector = new LLVector3(x, y, z); - - return vector; - } - - public LLQuaternion GetQuaternion(string s) - { - float x = GetFloat(s + "X"); - float y = GetFloat(s + "Y"); - float z = GetFloat(s + "Z"); - float w = GetFloat(s + "W"); - - LLQuaternion quaternion = new LLQuaternion(x, y, z, w); - - return quaternion; - } - } -} +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; +using libsecondlife; +using TribalMedia.Framework.Data; + +namespace OpenSim.Framework.Data +{ + public class OpenSimDataReader : DataReader + { + public OpenSimDataReader(IDataReader source) : base(source) + { + } + + public LLVector3 GetVector(string s) + { + float x = GetFloat(s + "X"); + float y = GetFloat(s + "Y"); + float z = GetFloat(s + "Z"); + + LLVector3 vector = new LLVector3(x, y, z); + + return vector; + } + + public LLQuaternion GetQuaternion(string s) + { + float x = GetFloat(s + "X"); + float y = GetFloat(s + "Y"); + float z = GetFloat(s + "Z"); + float w = GetFloat(s + "W"); + + LLQuaternion quaternion = new LLQuaternion(x, y, z, w); + + return quaternion; + } + } +} diff --git a/OpenSim/Framework/Data/OpenSimDatabaseMapper.cs b/OpenSim/Framework/Data/OpenSimDatabaseMapper.cs index 20011106bf..bb8246252c 100644 --- a/OpenSim/Framework/Data/OpenSimDatabaseMapper.cs +++ b/OpenSim/Framework/Data/OpenSimDatabaseMapper.cs @@ -1,23 +1,23 @@ -using System.Data.Common; -using libsecondlife; -using TribalMedia.Framework.Data; - -namespace OpenSim.Framework.Data -{ - public abstract class OpenSimDatabaseMapper : DatabaseMapper - { - public OpenSimDatabaseMapper(string connectionString) : base(connectionString) - { - } - - public override object ConvertToDbType(object value) - { - if (value is LLUUID) - { - return ((LLUUID) value).UUID.ToString(); - } - - return base.ConvertToDbType(value); - } - } -} +using System.Data.Common; +using libsecondlife; +using TribalMedia.Framework.Data; + +namespace OpenSim.Framework.Data +{ + public abstract class OpenSimDatabaseMapper : DatabaseMapper + { + public OpenSimDatabaseMapper(string connectionString) : base(connectionString) + { + } + + public override object ConvertToDbType(object value) + { + if (value is LLUUID) + { + return ((LLUUID) value).UUID.ToString(); + } + + return base.ConvertToDbType(value); + } + } +} diff --git a/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs b/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs index 2b20a79734..b718fe476c 100644 --- a/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs +++ b/OpenSim/Framework/Data/OpenSimObjectFieldMapper.cs @@ -1,73 +1,73 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using TribalMedia.Framework.Data; - -namespace OpenSim.Framework.Data -{ - public class OpenSimObjectFieldMapper : ObjectField - { - public OpenSimObjectFieldMapper(TableMapper tableMapper, string fieldName, - ObjectGetAccessor rowMapperGetAccessor, - ObjectSetAccessor rowMapperSetAccessor) - : base(tableMapper, fieldName, rowMapperGetAccessor, rowMapperSetAccessor) - { - } - - public override void ExpandField(TObj obj, System.Data.Common.DbCommand command, List fieldNames) - { - string fieldName = FieldName; - object value = GetParamValue(obj); - - if (ValueType == typeof(LLVector3)) - { - LLVector3 vector = (LLVector3)value; - - RawAddParam(command, fieldNames, fieldName + "X", vector.X); - RawAddParam(command, fieldNames, fieldName + "Y", vector.Y); - RawAddParam(command, fieldNames, fieldName + "Z", vector.Z); - } - else if (ValueType == typeof(LLQuaternion)) - { - LLQuaternion quaternion = (LLQuaternion)value; - - RawAddParam(command, fieldNames, fieldName + "X", quaternion.X); - RawAddParam(command, fieldNames, fieldName + "Y", quaternion.Y); - RawAddParam(command, fieldNames, fieldName + "Z", quaternion.Z); - RawAddParam(command, fieldNames, fieldName + "W", quaternion.W); - } - else - { - base.ExpandField(obj, command, fieldNames); - } - } - - protected override object GetValue(DataReader reader) - { - object value; - - OpenSimDataReader osreader = (OpenSimDataReader) reader; - - if (ValueType == typeof(LLVector3)) - { - value = osreader.GetVector(FieldName); - } - else if (ValueType == typeof(LLQuaternion)) - { - value = osreader.GetQuaternion(FieldName); - } - else if (ValueType == typeof(LLUUID)) - { - Guid guid = reader.GetGuid(FieldName); - value = new LLUUID(guid); - } - else - { - value = base.GetValue(reader); - } - - return value; - } - } -} +using System; +using System.Collections.Generic; +using System.Text; +using libsecondlife; +using TribalMedia.Framework.Data; + +namespace OpenSim.Framework.Data +{ + public class OpenSimObjectFieldMapper : ObjectField + { + public OpenSimObjectFieldMapper(TableMapper tableMapper, string fieldName, + ObjectGetAccessor rowMapperGetAccessor, + ObjectSetAccessor rowMapperSetAccessor) + : base(tableMapper, fieldName, rowMapperGetAccessor, rowMapperSetAccessor) + { + } + + public override void ExpandField(TObj obj, System.Data.Common.DbCommand command, List fieldNames) + { + string fieldName = FieldName; + object value = GetParamValue(obj); + + if (ValueType == typeof(LLVector3)) + { + LLVector3 vector = (LLVector3)value; + + RawAddParam(command, fieldNames, fieldName + "X", vector.X); + RawAddParam(command, fieldNames, fieldName + "Y", vector.Y); + RawAddParam(command, fieldNames, fieldName + "Z", vector.Z); + } + else if (ValueType == typeof(LLQuaternion)) + { + LLQuaternion quaternion = (LLQuaternion)value; + + RawAddParam(command, fieldNames, fieldName + "X", quaternion.X); + RawAddParam(command, fieldNames, fieldName + "Y", quaternion.Y); + RawAddParam(command, fieldNames, fieldName + "Z", quaternion.Z); + RawAddParam(command, fieldNames, fieldName + "W", quaternion.W); + } + else + { + base.ExpandField(obj, command, fieldNames); + } + } + + protected override object GetValue(DataReader reader) + { + object value; + + OpenSimDataReader osreader = (OpenSimDataReader) reader; + + if (ValueType == typeof(LLVector3)) + { + value = osreader.GetVector(FieldName); + } + else if (ValueType == typeof(LLQuaternion)) + { + value = osreader.GetQuaternion(FieldName); + } + else if (ValueType == typeof(LLUUID)) + { + Guid guid = reader.GetGuid(FieldName); + value = new LLUUID(guid); + } + else + { + value = base.GetValue(reader); + } + + return value; + } + } +} diff --git a/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs b/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs index 8026373134..ab0115e65e 100644 --- a/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs +++ b/OpenSim/Framework/Data/PrimitiveBaseShapeTableMapper.cs @@ -1,143 +1,143 @@ -using System; -using OpenSim.Framework; -using TribalMedia.Framework.Data; -using libsecondlife; - -namespace OpenSim.Framework.Data -{ - public class PrimitiveBaseShapeRowMapper : RowMapper - { - public Guid SceneObjectPartId; - - public PrimitiveBaseShapeRowMapper(Schema schema, PrimitiveBaseShape obj) : base(schema, obj) - { - } - } - - public class PrimitiveBaseShapeTableMapper : ObjectTableMapper - { - public PrimitiveBaseShapeTableMapper(DatabaseMapper connection, string tableName) - : base(connection, tableName) - { - RowMapperSchema rowMapperSchema = new RowMapperSchema(this); - m_schema = rowMapperSchema; - - m_keyFieldMapper = rowMapperSchema.AddMapping("SceneObjectPartId", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.SceneObjectPartId; }, - delegate(PrimitiveBaseShapeRowMapper shape, Guid value) { shape.SceneObjectPartId = value; }); - - rowMapperSchema.AddMapping("PCode", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PCode; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PCode = value; }); - - rowMapperSchema.AddMapping("PathBegin", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathBegin; }, - delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.PathBegin = value; }); - - rowMapperSchema.AddMapping("PathEnd", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathEnd; }, - delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.PathEnd = value; }); - - rowMapperSchema.AddMapping("PathScaleX", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathScaleX; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathScaleX = value; }); - - rowMapperSchema.AddMapping("PathScaleY", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathScaleY; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathScaleY = value; }); - - rowMapperSchema.AddMapping("PathShearX", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathShearX; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathShearX = value; }); - - rowMapperSchema.AddMapping("PathShearY", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathShearY; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathShearY = value; }); - - rowMapperSchema.AddMapping("ProfileBegin", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileBegin; }, - delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.ProfileBegin = value; }); - - rowMapperSchema.AddMapping("ProfileEnd", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileEnd; }, - delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.ProfileEnd = value; }); - - rowMapperSchema.AddMapping("Scale", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.Scale; }, - delegate(PrimitiveBaseShapeRowMapper shape, LLVector3 value) { shape.Object.Scale = value; }); - - rowMapperSchema.AddMapping("PathTaperX", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTaperX; }, - delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTaperX = value; }); - - rowMapperSchema.AddMapping("PathTaperY", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTaperY; }, - delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTaperY = value; }); - - rowMapperSchema.AddMapping("PathTwist", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTwist; }, - delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTwist = value; }); - - rowMapperSchema.AddMapping("PathRadiusOffset", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathRadiusOffset; }, - delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathRadiusOffset = value; }); - - rowMapperSchema.AddMapping("PathRevolutions", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathRevolutions; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathRevolutions = value; }); - - rowMapperSchema.AddMapping("PathTwistBegin", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTwistBegin; }, - delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTwistBegin = value; }); - - rowMapperSchema.AddMapping("PathCurve", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathCurve; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathCurve = value; }); - - rowMapperSchema.AddMapping("ProfileCurve", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileCurve; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.ProfileCurve = value; }); - - rowMapperSchema.AddMapping("ProfileHollow", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileHollow; }, - delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.ProfileHollow = value; }); - - rowMapperSchema.AddMapping("TextureEntry", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.TextureEntry; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.TextureEntry = value; }); - - rowMapperSchema.AddMapping("ExtraParams", - delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ExtraParams; }, - delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; }); - } - - public override PrimitiveBaseShapeRowMapper FromReader(DataReader reader) - { - PrimitiveBaseShape shape = new PrimitiveBaseShape(); - - PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper(m_schema, shape); - mapper.FillObject( reader ); - - return mapper; - } - - public bool Update(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape) - { - PrimitiveBaseShapeRowMapper mapper = CreateRowMapper(sceneObjectPartId, primitiveBaseShape); - return Update(sceneObjectPartId, mapper); - } - - public bool Add(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape) - { - PrimitiveBaseShapeRowMapper mapper = CreateRowMapper(sceneObjectPartId, primitiveBaseShape); - return Add(mapper); - } - - private PrimitiveBaseShapeRowMapper CreateRowMapper(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape) - { - PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper( m_schema, primitiveBaseShape ); - mapper.SceneObjectPartId = sceneObjectPartId; - return mapper; - } - } +using System; +using OpenSim.Framework; +using TribalMedia.Framework.Data; +using libsecondlife; + +namespace OpenSim.Framework.Data +{ + public class PrimitiveBaseShapeRowMapper : RowMapper + { + public Guid SceneObjectPartId; + + public PrimitiveBaseShapeRowMapper(Schema schema, PrimitiveBaseShape obj) : base(schema, obj) + { + } + } + + public class PrimitiveBaseShapeTableMapper : ObjectTableMapper + { + public PrimitiveBaseShapeTableMapper(DatabaseMapper connection, string tableName) + : base(connection, tableName) + { + RowMapperSchema rowMapperSchema = new RowMapperSchema(this); + m_schema = rowMapperSchema; + + m_keyFieldMapper = rowMapperSchema.AddMapping("SceneObjectPartId", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.SceneObjectPartId; }, + delegate(PrimitiveBaseShapeRowMapper shape, Guid value) { shape.SceneObjectPartId = value; }); + + rowMapperSchema.AddMapping("PCode", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PCode; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PCode = value; }); + + rowMapperSchema.AddMapping("PathBegin", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathBegin; }, + delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.PathBegin = value; }); + + rowMapperSchema.AddMapping("PathEnd", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathEnd; }, + delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.PathEnd = value; }); + + rowMapperSchema.AddMapping("PathScaleX", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathScaleX; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathScaleX = value; }); + + rowMapperSchema.AddMapping("PathScaleY", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathScaleY; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathScaleY = value; }); + + rowMapperSchema.AddMapping("PathShearX", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathShearX; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathShearX = value; }); + + rowMapperSchema.AddMapping("PathShearY", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathShearY; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathShearY = value; }); + + rowMapperSchema.AddMapping("ProfileBegin", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileBegin; }, + delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.ProfileBegin = value; }); + + rowMapperSchema.AddMapping("ProfileEnd", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileEnd; }, + delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.ProfileEnd = value; }); + + rowMapperSchema.AddMapping("Scale", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.Scale; }, + delegate(PrimitiveBaseShapeRowMapper shape, LLVector3 value) { shape.Object.Scale = value; }); + + rowMapperSchema.AddMapping("PathTaperX", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTaperX; }, + delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTaperX = value; }); + + rowMapperSchema.AddMapping("PathTaperY", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTaperY; }, + delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTaperY = value; }); + + rowMapperSchema.AddMapping("PathTwist", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTwist; }, + delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTwist = value; }); + + rowMapperSchema.AddMapping("PathRadiusOffset", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathRadiusOffset; }, + delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathRadiusOffset = value; }); + + rowMapperSchema.AddMapping("PathRevolutions", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathRevolutions; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathRevolutions = value; }); + + rowMapperSchema.AddMapping("PathTwistBegin", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathTwistBegin; }, + delegate(PrimitiveBaseShapeRowMapper shape, sbyte value) { shape.Object.PathTwistBegin = value; }); + + rowMapperSchema.AddMapping("PathCurve", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.PathCurve; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.PathCurve = value; }); + + rowMapperSchema.AddMapping("ProfileCurve", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileCurve; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte value) { shape.Object.ProfileCurve = value; }); + + rowMapperSchema.AddMapping("ProfileHollow", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ProfileHollow; }, + delegate(PrimitiveBaseShapeRowMapper shape, ushort value) { shape.Object.ProfileHollow = value; }); + + rowMapperSchema.AddMapping("TextureEntry", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.TextureEntry; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.TextureEntry = value; }); + + rowMapperSchema.AddMapping("ExtraParams", + delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ExtraParams; }, + delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; }); + } + + public override PrimitiveBaseShapeRowMapper FromReader(DataReader reader) + { + PrimitiveBaseShape shape = new PrimitiveBaseShape(); + + PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper(m_schema, shape); + mapper.FillObject( reader ); + + return mapper; + } + + public bool Update(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape) + { + PrimitiveBaseShapeRowMapper mapper = CreateRowMapper(sceneObjectPartId, primitiveBaseShape); + return Update(sceneObjectPartId, mapper); + } + + public bool Add(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape) + { + PrimitiveBaseShapeRowMapper mapper = CreateRowMapper(sceneObjectPartId, primitiveBaseShape); + return Add(mapper); + } + + private PrimitiveBaseShapeRowMapper CreateRowMapper(Guid sceneObjectPartId, PrimitiveBaseShape primitiveBaseShape) + { + PrimitiveBaseShapeRowMapper mapper = new PrimitiveBaseShapeRowMapper( m_schema, primitiveBaseShape ); + mapper.SceneObjectPartId = sceneObjectPartId; + return mapper; + } + } } \ No newline at end of file