aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Animation.cs
diff options
context:
space:
mode:
authordiva2009-04-01 19:50:09 +0000
committerdiva2009-04-01 19:50:09 +0000
commit6e368c4b590529fc64828d06dfb410a646efef85 (patch)
tree55ffc599b522f1d77823ae5afec18175593cf1d2 /OpenSim/Framework/Animation.cs
parent* Upped trunk version number to 0.6.4 as we just tagged 0.6.4-release (diff)
downloadopensim-SC_OLD-6e368c4b590529fc64828d06dfb410a646efef85.zip
opensim-SC_OLD-6e368c4b590529fc64828d06dfb410a646efef85.tar.gz
opensim-SC_OLD-6e368c4b590529fc64828d06dfb410a646efef85.tar.bz2
opensim-SC_OLD-6e368c4b590529fc64828d06dfb410a646efef85.tar.xz
Refactoring, no functional changes. Moved ChildAgentDataUpdate data structures from OpenSim.Region.Framework.Scenes back to OpenSim.Framework, so they can be referenced more broadly. This involved having to move the small Animation data structure to OpenSim.Framework too.
Diffstat (limited to 'OpenSim/Framework/Animation.cs')
-rw-r--r--OpenSim/Framework/Animation.cs94
1 files changed, 94 insertions, 0 deletions
diff --git a/OpenSim/Framework/Animation.cs b/OpenSim/Framework/Animation.cs
new file mode 100644
index 0000000..cda8387
--- /dev/null
+++ b/OpenSim/Framework/Animation.cs
@@ -0,0 +1,94 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using OpenMetaverse;
30using OpenMetaverse.StructuredData;
31
32namespace OpenSim.Framework
33{
34 [Serializable]
35 public class Animation
36 {
37 private UUID animID;
38 public UUID AnimID
39 {
40 get { return animID; }
41 set { animID = value; }
42 }
43
44 private int sequenceNum;
45 public int SequenceNum
46 {
47 get { return sequenceNum; }
48 set { sequenceNum = value; }
49 }
50
51 private UUID objectID;
52 public UUID ObjectID
53 {
54 get { return objectID; }
55 set { objectID = value; }
56 }
57
58 public Animation()
59 {
60 }
61
62 public Animation(UUID animID, int sequenceNum, UUID objectID)
63 {
64 this.animID = animID;
65 this.sequenceNum = sequenceNum;
66 this.objectID = objectID;
67 }
68
69 public Animation(OSDMap args)
70 {
71 UnpackUpdateMessage(args);
72 }
73
74 public OSDMap PackUpdateMessage()
75 {
76 OSDMap anim = new OSDMap();
77 anim["animation"] = OSD.FromUUID(animID);
78 anim["object_id"] = OSD.FromUUID(objectID);
79 anim["seq_num"] = OSD.FromInteger(sequenceNum);
80 return anim;
81 }
82
83 public void UnpackUpdateMessage(OSDMap args)
84 {
85 if (args["animation"] != null)
86 animID = args["animation"].AsUUID();
87 if (args["object_id"] != null)
88 objectID = args["object_id"].AsUUID();
89 if (args["seq_num"] != null)
90 sequenceNum = args["seq_num"].AsInteger();
91 }
92
93 }
94}