namespace  { using ; using System; using System.Collections; internal class Œ { private .[,] ; private byte[,] ; private bool[,] ; private int ; private int ; private Ÿ ; private Ÿ ; private  ; private  ; private ArrayList ; private ArrayList ; public int[] (int X, int Y, int goalX, int goalY) { if ((X == goalX) && (Y == goalY)) { return null; } int num = this. * this.; int num2 = 0; this. = new Œ.(goalX, goalY, 0.0, null, null, this); this. = new Œ.(X, Y, 0.0, null, this., this); this..Add(this.); while (this..Count > 0) { if (num2 == num) { return null; } num2++; Œ.  = (Œ.) this..‰(); if (.(this.)) { while ( != null) { this..Insert(0, );  = .; } break; } .(); this. = .(); foreach (Œ. 2 in this.) { Œ. 3 = null; if (this..Contains(2)) { 3 = (Œ.) this.[this..IndexOf(2)]; if (2.() > 3.()) { continue; } } Œ. 4 = null; if (this..Contains(2)) { 4 = (Œ.) this.[this..IndexOf(2)]; if (2.() > 4.()) { continue; } } this..Remove(3); this..Remove(4); this..Š(2); } this..Add(); } if (this..Count == 0) { return null; } Œ. 5 = (Œ.) this.[1]; return new int[] { 5., 5. }; } private bool (int X, int Y) { try { if (this.[X, Y]) { return false; } if ((this.[X, Y] != ..) && (this.[X, Y] != ..)) { return false; } return true; } catch { return false; } } private bool (int X, int Y, int goalX, int goalY) { try { int num = this.[X, Y]; int num2 = this.[goalX, goalY]; for (int i = -1; i <= 1; i++) { if (num == (num2 - i)) { return true; } } return false; } catch { return false; } } public Œ(.[,] stateMap, byte[,] heightMap, bool[,] unitMap) { this. = stateMap; this. = heightMap; this. = unitMap; this. = unitMap.GetLength(1) - 1; this. = unitMap.GetLength(0) - 1; this. = new Ÿ(); this. = new Ÿ(); this. = new ArrayList(); this. = new ArrayList(); } private class  : IComparable { internal int ; internal int ; internal Œ. ; private Œ. ; private Œ ; private double ; private double ; private ArrayList ; internal bool (Œ. Node) { return ((this. == Node.) && (this. == Node.)); } private void (int X, int Y) { if (this..(X, Y) && this..(this., this., X, Y)) { Œ.  = new Œ.(X, Y, this., this, this., this.); this..Add(); } } internal void () { this.(this. - 1, this.); this.(this. + 1, this.); this.(this., this. - 1); this.(this., this. + 1); if (this..(this., this. - 1)) { if (this..(this. - 1, this.)) { this.(this. - 1, this. - 1); } if (this..(this. + 1, this.)) { this.(this. + 1, this. - 1); } } if (this..(this. + 1, this.) && this..(this., this. + 1)) { this.(this. + 1, this. + 1); } if (this..(this. - 1, this.) && this..(this., this. - 1)) { this.(this. - 1, this. + 1); } } internal (int X, int Y, double Cost, Œ. parentNode, Œ. goalNode, Œ parentPathfinder) { this. = X; this. = Y; this. = parentNode; this. = goalNode; this. = Cost; this. = parentPathfinder; this. = new ArrayList(); } int IComparable.CompareTo(object obj) { return -this.().CompareTo(((Œ.) obj).()); } internal ArrayList allSuccessors { get { return this.; } } internal double Cost { get { return this.; } set { this. = value; } } internal double goalEstimate { get { if (this. == null) { this. = 0.0; } else { double x = this. - this..; double num2 = this. - this..; this. = Math.Sqrt(Math.Pow(x, 2.0) + Math.Pow(num2, 2.0)); } return this.; } set { this. = value; } } internal double totalCost { get { return (this. + this.()); } } } } }