Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -2,14 +2,14 @@ using Server.Targeting;
namespace Server
{
public delegate void BoundingBoxCallback(Mobile from, Map map, Point3D start, Point3D end, object state);
public delegate void BoundingBoxCallback(Map map, Point3D start, Point3D end);
public class BoundingBoxPicker
public static class BoundingBoxPicker
{
public static void Begin(Mobile from, BoundingBoxCallback callback, object state)
public static void Begin(Mobile from, BoundingBoxCallback callback)
{
from.SendMessage("Target the first location of the bounding box.");
from.Target = new PickTarget(callback, state);
from.Target = new PickTarget(callback);
}
private class PickTarget : Target
@ -17,21 +17,18 @@ namespace Server
private BoundingBoxCallback m_Callback;
private bool m_First;
private Map m_Map;
private object m_State;
private Point3D m_Store;
public PickTarget(BoundingBoxCallback callback, object state) : this(Point3D.Zero, true, null, callback, state)
public PickTarget(BoundingBoxCallback callback) : this(Point3D.Zero, true, null, callback)
{
}
public PickTarget(Point3D store, bool first, Map map, BoundingBoxCallback callback, object state) : base(-1,
true, TargetFlags.None)
public PickTarget(Point3D store, bool first, Map map, BoundingBoxCallback callback) : base(-1, true, TargetFlags.None)
{
m_Store = store;
m_First = first;
m_Map = map;
m_Callback = callback;
m_State = state;
}
protected override void OnTarget(Mobile from, object targeted)
@ -45,7 +42,7 @@ namespace Server
if (m_First)
{
from.SendMessage("Target another location to complete the bounding box.");
from.Target = new PickTarget(new Point3D(p), false, from.Map, m_Callback, m_State);
from.Target = new PickTarget(new Point3D(p), false, from.Map, m_Callback);
}
else if (from.Map != m_Map)
{
@ -58,7 +55,7 @@ namespace Server
Utility.FixPoints(ref start, ref end);
m_Callback(from, m_Map, start, end, m_State);
m_Callback(m_Map, start, end);
}
}
}