Show / Hide Table of Contents

Class RestrictionExtensions

Contains extension methods for restrictions.

Inheritance
System.Object
RestrictionExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public static class RestrictionExtensions

Methods

Add(RestrictionCollection, UInt32)

Adds a new restriction.

Declaration
public static void Add(this RestrictionCollection restrictions, uint vertex1)
Parameters
RestrictionCollection restrictions

System.UInt32 vertex1

Add(RestrictionCollection, UInt32, UInt32)

Adds a new restriction.

Declaration
public static void Add(this RestrictionCollection restrictions, uint vertex1, uint vertex2)
Parameters
RestrictionCollection restrictions

System.UInt32 vertex1

System.UInt32 vertex2

Add(RestrictionCollection, UInt32, UInt32, UInt32)

Adds a new restriction.

Declaration
public static void Add(this RestrictionCollection restrictions, uint vertex1, uint vertex2, uint vertex3)
Parameters
RestrictionCollection restrictions

System.UInt32 vertex1

System.UInt32 vertex2

System.UInt32 vertex3

IsSequenceAllowed(IEnumerable<UInt32[]>, List<UInt32>)

Returns true if the given sequence is allowed for all the given restrictions.

Declaration
public static bool IsSequenceAllowed(this IEnumerable<uint[]> restrictions, List<uint> sequence)
Parameters
IEnumerable<System.UInt32[]> restrictions

List<System.UInt32> sequence

Returns
System.Boolean

IsSequenceAllowed(IEnumerable<UInt32[]>, UInt32[])

Returns true if the given sequence is allowed for all the given restrictions.

Declaration
public static bool IsSequenceAllowed(this IEnumerable<uint[]> restrictions, uint[] sequence)
Parameters
IEnumerable<System.UInt32[]> restrictions

System.UInt32[] sequence

Returns
System.Boolean

IsSequenceAllowed(UInt32[], List<UInt32>)

Returns true if the given seqence is allowed for the given restriction.

Declaration
public static bool IsSequenceAllowed(this uint[] restriction, List<uint> sequence)
Parameters
System.UInt32[] restriction

List<System.UInt32> sequence

Returns
System.Boolean

IsSequenceAllowed(UInt32[], UInt32[])

Returns true if the given seqence is allowed for the given restriction.

Declaration
public static bool IsSequenceAllowed(this uint[] restriction, uint[] sequence)
Parameters
System.UInt32[] restriction

System.UInt32[] sequence

Returns
System.Boolean

IsSequenceIdentical(UInt32[], UInt32[])

Compares two non-null sequences and checks if they have identical elements.

Declaration
public static bool IsSequenceIdentical(this uint[] s1, uint[] s2)
Parameters
System.UInt32[] s1

System.UInt32[] s2

Returns
System.Boolean

Match(List<UInt32>, UInt32[])

Returns the number of vertices in the sequence starting at the beginning that matches any part of the given restriction.

Declaration
public static int Match(this List<uint> sequence, uint[] restriction)
Parameters
List<System.UInt32> sequence

System.UInt32[] restriction

Returns
System.Int32

Match(UInt32[], UInt32[])

Returns the number of vertices in the sequence starting at the beginning that matches any part of the given restriction.

Declaration
public static int Match(this uint[] sequence, uint[] restriction)
Parameters
System.UInt32[] sequence

System.UInt32[] restriction

Returns
System.Int32

MatchAny(List<UInt32>, IEnumerable<UInt32[]>)

Returns the largest number of vertices in the sequence starting at the beginning that matches any part of any of the given restrictions.

Declaration
public static int MatchAny(this List<uint> sequence, IEnumerable<uint[]> restrictions)
Parameters
List<System.UInt32> sequence

IEnumerable<System.UInt32[]> restrictions

Returns
System.Int32

MatchAny(UInt32[], IEnumerable<UInt32[]>)

Returns the largest number of vertices in the sequence starting at the beginning that matches any part of any of the given restrictions.

Declaration
public static int MatchAny(this uint[] sequence, IEnumerable<uint[]> restrictions)
Parameters
System.UInt32[] sequence

IEnumerable<System.UInt32[]> restrictions

Returns
System.Int32

MatchAnyReverse(List<UInt32>, IEnumerable<UInt32[]>)

Returns the largest number of vertices in the sequence starting at the beginning that matches any part of any of the given restrictions.

Declaration
public static int MatchAnyReverse(this List<uint> sequence, IEnumerable<uint[]> restrictions)
Parameters
List<System.UInt32> sequence

IEnumerable<System.UInt32[]> restrictions

Returns
System.Int32

MatchAnyReverse(UInt32[], IEnumerable<UInt32[]>)

Returns the largest number of vertices in the sequence starting at the beginning that matches any part of any of the given restrictions.

Declaration
public static int MatchAnyReverse(this uint[] sequence, IEnumerable<uint[]> restrictions)
Parameters
System.UInt32[] sequence

IEnumerable<System.UInt32[]> restrictions

Returns
System.Int32

MatchReverse(List<UInt32>, UInt32[])

Returns the number of vertices in the sequence starting at the beginning that matches any part of the given restriction in reverse direction.

Declaration
public static int MatchReverse(this List<uint> sequence, uint[] restriction)
Parameters
List<System.UInt32> sequence

System.UInt32[] restriction

Returns
System.Int32

MatchReverse(UInt32[], UInt32[])

Returns the number of vertices in the sequence starting at the beginning that matches any part of the given restriction in reverse direction.

Declaration
public static int MatchReverse(this uint[] sequence, uint[] restriction)
Parameters
System.UInt32[] sequence

System.UInt32[] restriction

Returns
System.Int32

Restricts(Restriction, UInt32)

Returns true if the restriction restricts the one vertex.

Declaration
public static bool Restricts(this Restriction restriction, uint vertex)
Parameters
Restriction restriction

System.UInt32 vertex

Returns
System.Boolean

Restricts(RestrictionCollection, Turn)

Restricts the given turn.

Declaration
public static bool Restricts(this RestrictionCollection restrictions, Turn turn)
Parameters
RestrictionCollection restrictions

Turn turn

Returns
System.Boolean

Restricts(RestrictionCollection, UInt32)

Returns true if one of the restrictions restricts the one vertex.

Declaration
public static bool Restricts(this RestrictionCollection restrictions, uint vertex)
Parameters
RestrictionCollection restrictions

System.UInt32 vertex

Returns
System.Boolean

ShrinkFor(UInt32[], List<UInt32>)

Shrinks this restrictions assuming the given sequence has already been travelled. Sequence needs to match first part of the restriction.

[0, 1, 2, 3] for sequence [0, 1] returns [1, 2, 3] [0, 1, 2, 3] for sequence [0, 2] returns [] [0, 1, 2, 3] for sequence [1, 2] returns []

Declaration
public static uint[] ShrinkFor(this uint[] restriction, List<uint> sequence)
Parameters
System.UInt32[] restriction

List<System.UInt32> sequence

Returns
System.UInt32[]

ShrinkFor(UInt32[], UInt32[])

Shrinks this restrictions assuming the given sequence has already been travelled. Sequence needs to match first part of the restriction.

[0, 1, 2, 3] for sequence [0, 1] returns [1, 2, 3] [0, 1, 2, 3] for sequence [0, 2] returns [] [0, 1, 2, 3] for sequence [1, 2] returns []

Declaration
public static uint[] ShrinkFor(this uint[] restriction, uint[] sequence)
Parameters
System.UInt32[] restriction

System.UInt32[] sequence

Returns
System.UInt32[]

ShrinkForPart(UInt32[], List<UInt32>)

Shrinks this restriction assuming the given sequence has already been travelled. Last part of the sequence needs to match some of the first part of the restriction.

Declaration
public static uint[] ShrinkForPart(this uint[] restriction, List<uint> sequence)
Parameters
System.UInt32[] restriction

List<System.UInt32> sequence

Returns
System.UInt32[]

ShrinkForPart(UInt32[], UInt32[])

Shrinks this restriction assuming the given sequence has already been travelled. Last part of the sequence needs to match some of the first part of the restriction.

Declaration
public static uint[] ShrinkForPart(this uint[] restriction, uint[] sequence)
Parameters
System.UInt32[] restriction

System.UInt32[] sequence

Returns
System.UInt32[]

Back to top Built by Itinero, MIT licensed.