From 4e9403e6ef4d87235af639af7515a512a595b5ec Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Sat, 4 Apr 2009 08:33:58 +0000
Subject: * Renamed Heightmap.Height to Heightmap.Length to avoid confusion
about axis. * Added XMLDOC to MRM API code, this means we have usable
programming docs being produced here:
http://docs.opensimulator.org/namespaceOpenSim_1_1Region_1_1OptionalModules_1_1Scripting_1_1Minimodule.html
(eg IObject, IHeightmap, etc)
---
.../Scripting/Minimodule/Heightmap.cs | 2 +-
.../Scripting/Minimodule/IHeightmap.cs | 15 +++++++++++++--
.../OptionalModules/Scripting/Minimodule/IObject.cs | 21 +++++++++++++++++++++
3 files changed, 35 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/OptionalModules/Scripting')
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs
index 875de50..9b9d686 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
set { Set(x, y, value); }
}
- public int Height
+ public int Length
{
get { return m_scene.Heightmap.Height; }
}
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs
index afea12b..93cbc5b 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs
@@ -39,6 +39,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
/// X Coordinate
/// Y Coordinate
/// A value in meters representing height. Can be negative. Value correlates with Z parameter in world coordinates
+ ///
+ /// double heightVal = World.Heightmap[128,128];
+ /// World.Heightmap[128,128] *= 5.0;
+ /// World.Heightmap[128,128] = 25;
+ ///
double this[int x, int y]
{
get;
@@ -46,13 +51,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
}
///
- /// The maximum height of the region (Y axis), exclusive. (eg Height = 256, max Y = 255). Minimum is always 0 inclusive.
+ /// The maximum length of the region (Y axis), exclusive. (eg Height = 256, max Y = 255). Minimum is always 0 inclusive.
///
- int Height { get; }
+ ///
+ /// Host.Console.Info("The terrain length of this region is " + World.Heightmap.Length);
+ ///
+ int Length { get; }
///
/// The maximum width of the region (X axis), exclusive. (eg Width = 256, max X = 255). Minimum is always 0 inclusive.
///
+ ///
+ /// Host.Console.Info("The terrain width of this region is " + World.Heightmap.Width);
+ ///
int Width { get; }
}
}
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs
index 223d764..0308079 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IObject.cs
@@ -40,6 +40,27 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
/// exception. 'Exists' allows you to check the object is still
/// in play before utilizing it.
///
+ ///
+ /// IObject deleteMe = World.Objects[0];
+ ///
+ /// if(deleteMe.Exists) {
+ /// deleteMe.Say("Hello, I still exist!");
+ /// }
+ ///
+ /// World.Objects.Remove(deleteMe);
+ ///
+ /// if(!deleteMe.Exists) {
+ /// Host.Console.Info("I was deleted");
+ /// }
+ ///
+ ///
+ /// Objects should be near-guarunteed to exist for any event which
+ /// passes them as an argument. Storing an object for a longer period
+ /// of time however will limit their reliability.
+ ///
+ /// It is a good practice to use Try/Catch blocks handling for
+ /// NullReferenceException, when accessing remote objects.
+ ///
bool Exists { get; }
///
--
cgit v1.1