diff options
Diffstat (limited to 'src/Script_manager.cs')
-rw-r--r-- | src/Script_manager.cs | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/Script_manager.cs b/src/Script_manager.cs new file mode 100644 index 0000000..1de1d22 --- /dev/null +++ b/src/Script_manager.cs | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | Copyright (c) OpenSim project, http://osgrid.org/ | ||
3 | * All rights reserved. | ||
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 <organization> 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 <copyright holder> ``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 <copyright holder> 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 | */ | ||
28 | |||
29 | using System; | ||
30 | using System.Collections; | ||
31 | //using LuaInterface; | ||
32 | using libsecondlife; | ||
33 | |||
34 | namespace OpenSim | ||
35 | { | ||
36 | /// <summary> | ||
37 | /// Description of Script_manager. | ||
38 | /// </summary> | ||
39 | public class ScriptManager | ||
40 | { | ||
41 | //public LuaInterface.Lua Lu; | ||
42 | //private ArrayList scripts; | ||
43 | //private prim_info current_prim; | ||
44 | |||
45 | public ScriptManager() | ||
46 | { | ||
47 | } | ||
48 | |||
49 | /*public void start_up (Lua lua, App ap) | ||
50 | { | ||
51 | this.Lu=lua; | ||
52 | //register any lua routines , like check finish script one | ||
53 | Lu.OpenMathLib(); | ||
54 | }*/ | ||
55 | |||
56 | private void RegisterFunctions() | ||
57 | { | ||
58 | //lu.RegisterFunction( "RegisterScript",this,this.GetType().GetMethod("ScriptRegister")); | ||
59 | //lu.RegisterFunction( "MoveObject",this,this.GetType().GetMethod("MoveObject")); | ||
60 | //lu.RegisterFunction( "Say",this,this.GetType().GetMethod("Say")); | ||
61 | |||
62 | } | ||
63 | |||
64 | public void Call_tick(PrimInfo prim) | ||
65 | { | ||
66 | //set current prim and then call tick function in linked script | ||
67 | } | ||
68 | public void Call_touch(PrimInfo prim) | ||
69 | { | ||
70 | //set current prim and then call clicked function in linked script | ||
71 | |||
72 | } | ||
73 | public void Call_on_rex(PrimInfo prim) | ||
74 | { | ||
75 | //set current prim and then call clicked function in linked script | ||
76 | |||
77 | } | ||
78 | |||
79 | #region Lua Functions | ||
80 | |||
81 | public void ScriptRegister(script_object_interface script) | ||
82 | { | ||
83 | //called by scripts to register themselves | ||
84 | } | ||
85 | public void MoveObject(float x , float y, float z) | ||
86 | { | ||
87 | |||
88 | } | ||
89 | public void Say(string message) | ||
90 | { | ||
91 | |||
92 | } | ||
93 | #endregion | ||
94 | |||
95 | } | ||
96 | |||
97 | public interface script_object_interface | ||
98 | { | ||
99 | void frame_tick(); | ||
100 | void touch(int num); | ||
101 | void on_rex(int num); | ||
102 | } | ||
103 | } | ||