示例#1
0
 /// <summary>
 /// Returns true if one of the restrictions restricts the one vertex.
 /// </summary>
 public static bool Restricts(this RestrictionCollection restrictions, uint vertex)
 {
     for (var r = 0; r < restrictions.Count; r++)
     {
         var restriction = restrictions[r];
         if (restriction.Restricts(vertex))
         {
             return(true);
         }
     }
     return(false);
 }
示例#2
0
 /// <summary>
 /// Restricts the given turn.
 /// </summary>
 public static bool Restricts(this RestrictionCollection restrictions, Turn turn)
 {
     return(turn.IsRestrictedBy(restrictions));
 }
示例#3
0
 /// <summary>
 /// Adds a new restriction.
 /// </summary>
 public static void Add(this RestrictionCollection restrictions, uint vertex1, uint vertex2, uint vertex3)
 {
     restrictions.Add(new Restriction(vertex1, vertex2, vertex3));
 }