Usage:
Arcs created by the library can be used immediately by Command with no modifications.
Example:
ScenEdit_UpdateUnit({guid='2c246071-b2a3-4603-a8a5-6d2033ff4a73', mode="add_sensor", dbid=3352, arc_detect=Arc():forward()})
Constructors:
This library adds a single function, Arc(), which provides several constructor methods for arcs:
Arc():from(from_angle):to(to_angle)
This will create a new arc which extends from from_angle, in degrees off of the front of the unit, to to_angle, in the same frame. Notably, the system sweeps clockwise, so, for example, Arc():from(0):to(0) will include all angles.
Examples:
Arc():from(0):to(90) -- front right quadrant
Arc():from(180):to(0) -- port side
Arc():new(arc)
The "new" method makes a library-usable arc from a default arc. This is used when adding arcs manually is desirable. Names are as in the default system, see here for them
Examples:
Arc():new({"SB1"}) -- adds the "SB1" arc.
Arc():all(), Arc():forward(), Arc():backward(), Arc():port(), Arc():starboard()
As the name implies, these return a pre-defined arc over the named area.
Examples:
Arc():all() -- an arc over all aspects
Arc():forward() -- an arc over the forward aspect
Arc Utilities:
Arcs created by the library can be added, using the + operator. For example, Arc():forward() + Arc():backward() is equivalent to Arc():all(). These arcs can then be added themselves, ad infinitum.
Arcs created by Arc() can be converted to string for printing and debug with the built-in tostring method, which prints out the names of the aspects included in the arc.