|
|
| Cassowary () |
| | Creates a new Cassowary solver.
|
| |
| void | AddConstraint (string constraintExpression, float strength=CassowaryStrength.Required) |
| | Adds a constraint to the system.
You cannot multiply or divide variables and expressions with each other.
Doing so will result in a error when attempting to add the constraint.
(You can, of course, multiply or divide by constants).
|
| |
| float | GetValue (string varName) |
| | Gets the value for the specified variable.
|
| |
|
void | Reset () |
| | Clear out this solver, removing all state, constraints and suggestions.
|
| |
| void | SuggestValue (string varName, float value, float strength=CassowaryStrength.Strong) |
| | Suggests a value to the solver.
|
| |
|
void | Dispose () |
| |
Represents a Cassowary engine structure.
A Cassowary is a type of solver. NWN uses them internally to resize the newer GUI window.
Examples
using NLog;
namespace NWN.Anvil.Samples
{
[ServiceBinding(typeof(CassowaryExamples))]
public class CassowaryExamples
{
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
public CassowaryExamples()
{
Log.Info($"Solution 1: Left: {cTest.GetValue("left")}, Middle: {cTest.GetValue("middle")}, Right: {cTest.GetValue("right")}");
Log.Info($"Solution 2: Left: {cTest.GetValue("left")}, Middle: {cTest.GetValue("middle")}, Right: {cTest.GetValue("right")}");
}
}
}