public static bool IsNorthWestFrom(this BoardLocation source, BoardLocation target) { //PGN format for the board // A B C D E F G H //8:| 7|15|23|31|39|47|55|63| //7:| 6|14|22|30|38|46|54|62| //6:| 5|13|21|29|37|45|53|61| //5:| 4|12|20|28|36|44|52|60| //4:| 3|11|19|27|35|43|51|59| //3:| 2|10|18|26|34|42|50|58| //2:| 1| 9|17|25|33|41|49|57| //1:| 0| 8|16|24|32|40|48|56| return((source.ToByte() < target.ToByte()) && source.IsOnSameSlopeAs(target)); }
public static bool IsSouthEastFrom(this BoardLocation source, BoardLocation target) { return((source.ToByte() > target.ToByte()) && source.IsOnSameSlopeAs(target)); }