Esempio n. 1
0
 /// <summary>The <c>Hexside</c> corresponding to this <c>HexsideFlag</c>, or -1 if it doesn't exist.</summary>
 public static Hexside IndexOf(this HexsideFlags @this)
 {
     return((Hexside)HexsideFlags.IndexOf(@this));
 }
Esempio n. 2
0
 /// <summary>TODO</summary>
 /// <param name="this"></param>
 /// <param name="directions"></param>
 /// <returns></returns>
 public static IEnumerable <NeighbourHex> GetNeighbourHexes(this IHex @this, HexsideFlags directions)
 {
     return(from n in @this.GetNeighbourHexes()
            where directions.HasFlag(n.HexsideEntry.Direction()) && n.Hex.IsOnboard()
            select n);
 }
Esempio n. 3
0
 /// <summary>TODO</summary>
 public NeighbourHex(IHex hex, HexsideFlags hexside)  : this(hex, hexside.IndexOf())
 {
 }
Esempio n. 4
0
 ///<summary>Returns set of hexes at direction(s) specified by <c>hexsides</c>, as IEnumerable.</summary>
 public IEnumerable <NeighbourCoords> GetNeighbours(HexsideFlags hexsides)
 {
     return(GetNeighbours().Where(n => hexsides.HasFlag(n.Hexside)));
 }