[IoId("00000000-383b-45f5-af4a-69f0c397db09")] public sealed class NTuple : IStorable, IEquatable<NTuple>, IComparable<NTuple>
A combination of one or more named values.

Constructors

NTuple

#
public NTuple(IReader reader)
reader (IReader)

NTuple

#
public NTuple(params (string name, IPear pear)[] elements)
elements (params (string name, IPear pear)[])

Properties

Count

#
public int Count { get; }
Gets the number of elements.

Elements

#
public IEnumerable<(string name, IPear pear)> Elements { get; }
Enumerate over all elements.

Empty

#
public static NTuple Empty { get; }

Methods

CompareTo

#
public int CompareTo(NTuple other)
other (NTuple)

Equals

#
public bool Equals(NTuple other)
other (NTuple)

Equals

#
public override bool Equals(object obj)
obj (object)
Object.Equals

Get<T>

#
public bool Get<T>(string name, StringComparison comparison, out T value)
Get the value if defined.
name (string)Name of value to retrieve.
comparison (StringComparison)Comparison to use.
value (out T)Value if defined.
True if value was defined.

GetHashCode

#
public override int GetHashCode()

Grow

#
public NTuple Grow(string name, bool value)
Add a value to this tuple.
name (string)Name of value to add.
value (bool)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, Colour value)
Add a value to this tuple.
name (string)Name of value to add.
value (Colour)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, double value)
Add a value to this tuple.
name (string)Name of value to add.
value (double)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, int value)
Add a value to this tuple.
name (string)Name of value to add.
value (int)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, IPear pear)
Add a value to this tuple.
name (string)Name of value to add.
pear (IPear)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, Plane value)
Add a value to this tuple.
name (string)Name of value to add.
value (Plane)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, Point3d value)
Add a value to this tuple.
name (string)Name of value to add.
value (Point3d)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, string value)
Add a value to this tuple.
name (string)Name of value to add.
value (string)Value to add.
Tuple with added value.

Grow

#
public NTuple Grow(string name, Vector3d value)
Add a value to this tuple.
name (string)Name of value to add.
value (Vector3d)Value to add.
Tuple with added value.

IndexOf

#
public int IndexOf(string name, StringComparison comparison = StringComparison.Ordinal)
Find the index of the element with the given name.
name (string)
comparison (StringComparison = StringComparison.Ordinal)

IsValidName

#
public static bool IsValidName(string proposedName, out string validName, out string[] reasons)
Validate the name for a tuple element. Names may not contain wildcard characters.
proposedName (string)
validName (out string)
reasons (out string[])

Name

#
public string Name(int index)
Gets the name of the element at the given index.
index (int)

Pare

#
public NTuple Pare(string name, StringComparison comparison)
Remove the elements from this tuple with the given name.
name (string)
comparison (StringComparison)

PareWildcard

#
public NTuple PareWildcard(string name)
Remove all elements from this tuple which match the given name pattern.
name (string)

Pear

#
public IPear Pear(int index)
Gets the name of the element at the given index.
index (int)

Store

#
public void Store(IWriter writer)
writer (IWriter)
Store

ToString

#
public override string ToString()
Object.ToString

TryGet<T>

#
public bool TryGet<T>(string name, StringComparison comparison, ref T value)
Try and retrieve the value if defined.
name (string)Name of value to retrieve.
comparison (StringComparison)Comparison to use.
value (ref T)Value if defined.
True if value was defined.

Operators