diff options
author | lbsa71 | 2007-07-17 17:47:23 +0000 |
---|---|---|
committer | lbsa71 | 2007-07-17 17:47:23 +0000 |
commit | d95918f2288967de3937ec7aa648a5303eba4027 (patch) | |
tree | 7eeb692e0939d566da2e246a7077b8fcc68ec1b3 /OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |
parent | * Added "backup" console command for sdague (diff) | |
download | opensim-SC-d95918f2288967de3937ec7aa648a5303eba4027.zip opensim-SC-d95918f2288967de3937ec7aa648a5303eba4027.tar.gz opensim-SC-d95918f2288967de3937ec7aa648a5303eba4027.tar.bz2 opensim-SC-d95918f2288967de3937ec7aa648a5303eba4027.tar.xz |
* Changed SimpleApp to use EventManager and Scene timer
* Refactored a lot of m_* and public -> wrappers
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index af70f07..f7bf5d6 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -12,6 +12,7 @@ using OpenSim.Framework.Interfaces; | |||
12 | using OpenSim.Framework.Types; | 12 | using OpenSim.Framework.Types; |
13 | using OpenSim.Framework.Data; | 13 | using OpenSim.Framework.Data; |
14 | using OpenSim.Framework.Utilities; | 14 | using OpenSim.Framework.Utilities; |
15 | using OpenSim.Region.Environment.Scenes; | ||
15 | 16 | ||
16 | namespace SimpleApp | 17 | namespace SimpleApp |
17 | { | 18 | { |
@@ -78,9 +79,9 @@ namespace SimpleApp | |||
78 | #pragma warning restore 67 | 79 | #pragma warning restore 67 |
79 | 80 | ||
80 | private LLUUID myID = LLUUID.Random(); | 81 | private LLUUID myID = LLUUID.Random(); |
81 | public MyNpcCharacter() | 82 | public MyNpcCharacter( EventManager eventManager ) |
82 | { | 83 | { |
83 | 84 | eventManager.OnFrame += Update; | |
84 | } | 85 | } |
85 | 86 | ||
86 | public virtual LLVector3 StartPos | 87 | public virtual LLVector3 StartPos |
@@ -143,18 +144,9 @@ namespace SimpleApp | |||
143 | { | 144 | { |
144 | this.OnRegionHandShakeReply(this); | 145 | this.OnRegionHandShakeReply(this); |
145 | this.OnCompleteMovementToRegion(); | 146 | this.OnCompleteMovementToRegion(); |
146 | this.StartMovement(); | ||
147 | } | ||
148 | |||
149 | public void StartMovement() | ||
150 | { | ||
151 | Timer timer = new Timer(); | ||
152 | timer.Enabled = true; | ||
153 | timer.Interval = 500; | ||
154 | timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); | ||
155 | } | 147 | } |
156 | 148 | ||
157 | public void Heartbeat(object sender, EventArgs e) | 149 | private void Update( ) |
158 | { | 150 | { |
159 | Encoding enc = Encoding.ASCII; | 151 | Encoding enc = Encoding.ASCII; |
160 | 152 | ||