diff options
author | lbsa71 | 2008-01-14 22:34:19 +0000 |
---|---|---|
committer | lbsa71 | 2008-01-14 22:34:19 +0000 |
commit | 6d751411b7f996c486052c8cbbdbe1e186cebd9f (patch) | |
tree | eb7a0a101695e85cefb3a8f0ed540d402caedc63 /OpenSim/Framework/Data/OpenSimDataReader.cs | |
parent | my Exists check was slow and wrong. This fixes issues people (diff) | |
download | opensim-SC_OLD-6d751411b7f996c486052c8cbbdbe1e186cebd9f.zip opensim-SC_OLD-6d751411b7f996c486052c8cbbdbe1e186cebd9f.tar.gz opensim-SC_OLD-6d751411b7f996c486052c8cbbdbe1e186cebd9f.tar.bz2 opensim-SC_OLD-6d751411b7f996c486052c8cbbdbe1e186cebd9f.tar.xz |
* Added specialization of DatabaseMapper, DataReader and ObjectFieldMapper to support LLVector3, LLQuaternion and LLUUID
* Added PrimitiveBaseShapeTableMapper to show how it's done
NOTE: Nothing actually works yet - this code should be considered more of educational value until it's all wired together
Diffstat (limited to 'OpenSim/Framework/Data/OpenSimDataReader.cs')
-rw-r--r-- | OpenSim/Framework/Data/OpenSimDataReader.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data/OpenSimDataReader.cs b/OpenSim/Framework/Data/OpenSimDataReader.cs new file mode 100644 index 0000000..225df60 --- /dev/null +++ b/OpenSim/Framework/Data/OpenSimDataReader.cs | |||
@@ -0,0 +1,39 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Data; | ||
4 | using System.Text; | ||
5 | using libsecondlife; | ||
6 | using TribalMedia.Framework.Data; | ||
7 | |||
8 | namespace OpenSim.Framework.Data | ||
9 | { | ||
10 | public class OpenSimDataReader : DataReader | ||
11 | { | ||
12 | public OpenSimDataReader(IDataReader source) : base(source) | ||
13 | { | ||
14 | } | ||
15 | |||
16 | public LLVector3 GetVector(string s) | ||
17 | { | ||
18 | float x = GetFloat(s + "X"); | ||
19 | float y = GetFloat(s + "Y"); | ||
20 | float z = GetFloat(s + "Z"); | ||
21 | |||
22 | LLVector3 vector = new LLVector3(x, y, z); | ||
23 | |||
24 | return vector; | ||
25 | } | ||
26 | |||
27 | public LLQuaternion GetQuaternion(string s) | ||
28 | { | ||
29 | float x = GetFloat(s + "X"); | ||
30 | float y = GetFloat(s + "Y"); | ||
31 | float z = GetFloat(s + "Z"); | ||
32 | float w = GetFloat(s + "W"); | ||
33 | |||
34 | LLQuaternion quaternion = new LLQuaternion(x, y, z, w); | ||
35 | |||
36 | return quaternion; | ||
37 | } | ||
38 | } | ||
39 | } | ||