aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-03 23:20:36 +0100
committerJustin Clark-Casey (justincc)2011-08-03 23:20:36 +0100
commit61d49d4f63eafa68d0b63877029da3475d977263 (patch)
treea1d6f6c51ac50a9b9920f4dcd74765e5ad70feee
parentextend move test to check avatar is moving in the right direction after setti... (diff)
downloadopensim-SC_OLD-61d49d4f63eafa68d0b63877029da3475d977263.zip
opensim-SC_OLD-61d49d4f63eafa68d0b63877029da3475d977263.tar.gz
opensim-SC_OLD-61d49d4f63eafa68d0b63877029da3475d977263.tar.bz2
opensim-SC_OLD-61d49d4f63eafa68d0b63877029da3475d977263.tar.xz
rename NPC.Autopilot to NPC.MoveToTarget internally. Add method doc to INPCModule
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs32
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
4 files changed, 34 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index 21a755f..fa8d6b6 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -32,9 +32,39 @@ namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface INPCModule 33 public interface INPCModule
34 { 34 {
35 /// <summary>
36 /// Create an NPC
37 /// </summary>
38 /// <param name="firstname"></param>
39 /// <param name="lastname"></param>
40 /// <param name="position"></param>
41 /// <param name="scene"></param>
42 /// <param name="cloneAppearanceFrom">The UUID of the avatar from which to clone the NPC's appearance from.</param>
43 /// <returns>The UUID of the ScenePresence created.</returns>
35 UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom); 44 UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom);
36 void Autopilot(UUID agentID, Scene scene, Vector3 pos); 45
46 /// <summary>
47 /// Move an NPC to a target over time.
48 /// </summary>
49 /// <param name="agentID">The UUID of the NPC</param>
50 /// <param name="scene"></param>
51 /// <param name="pos"></param>
52 void MoveToTarget(UUID agentID, Scene scene, Vector3 pos);
53
54 /// <summary>
55 /// Get the NPC to say something.
56 /// </summary>
57 /// <param name="agentID">The UUID of the NPC</param>
58 /// <param name="scene"></param>
59 /// <param name="text"></param>
37 void Say(UUID agentID, Scene scene, string text); 60 void Say(UUID agentID, Scene scene, string text);
61
62
63 /// <summary>
64 /// Delete an NPC.
65 /// </summary>
66 /// <param name="agentID">The UUID of the NPC</param>
67 /// <param name="scene"></param>
38 void DeleteNPC(UUID agentID, Scene scene); 68 void DeleteNPC(UUID agentID, Scene scene);
39 } 69 }
40} \ No newline at end of file 70} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 1d88e43..f9c41d7 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -177,7 +177,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
177 return npcAvatar.AgentId; 177 return npcAvatar.AgentId;
178 } 178 }
179 179
180 public void Autopilot(UUID agentID, Scene scene, Vector3 pos) 180 public void MoveToTarget(UUID agentID, Scene scene, Vector3 pos)
181 { 181 {
182 lock (m_avatars) 182 lock (m_avatars)
183 { 183 {
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index 512405a..2e3d431 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
113 Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); 113 Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
114 114
115 Vector3 targetPos = new Vector3(128, 128, 40); 115 Vector3 targetPos = new Vector3(128, 128, 40);
116 npcModule.Autopilot(npc.UUID, scene, targetPos); 116 npcModule.MoveToTarget(npc.UUID, scene, targetPos);
117 117
118 Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); 118 Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
119 119
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b710229..8093502 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2110,7 +2110,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2110 if (module != null) 2110 if (module != null)
2111 { 2111 {
2112 Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z); 2112 Vector3 pos = new Vector3((float) position.x, (float) position.y, (float) position.z);
2113 module.Autopilot(new UUID(npc.m_string), World, pos); 2113 module.MoveToTarget(new UUID(npc.m_string), World, pos);
2114 } 2114 }
2115 } 2115 }
2116 2116