FunVec1T(T, Opt`1Int32) Constructor

1-dimensional vector with optional length, which always yields the same constant value.
C#
var agentSmith = GetSmith();
FunVec1<Agent> vec = new(agentSmith);
Assert(vec.Length1 == int.MaxValue); // since length1 is omitted
Assert(vec[0] == agentSmith);
Assert(vec[42] == agentSmith);
Assert(vec.Get(100) == Some(agentSmith));

FunVec1<Agent> vec = new(agentSmith, Some(50));
Assert(vec.Length1 == 50);
Assert(vec[0] == agentSmith);
Assert(vec[42] == agentSmith);
Assert(vec.Get(100).IsNone);

Definition

Namespace: Orx.Fun.FunVec
Assembly: Orx.Fun.FunVec (in Orx.Fun.FunVec.dll) Version: 1.0.0
C#
public FunVec1(
	T constantValue,
	Opt<int> length1 = default
)

Parameters

constantValue  T
Constant value that every position of the jagged array will return.
length1  OptInt32  (Optional)
Optional length of the jagged array; will default to None (int.MaxValue) when omitted.

See Also