namespace  { using ; using System; using System.Collections; internal class  { private .[,] ; private double[,] ; private bool[,] ; private int ; private int ; private . ; private . ; private Ÿ  = new Ÿ(); private Ÿ  = new Ÿ(); private ArrayList  = new ArrayList(); public  (int X, int Y, int goalX, int goalY) { if ((X == goalX) && (Y == goalY)) { return new (-1, 0); } int num = (this. * this.) ^ 2; int num2 = 0; ArrayList list = new ArrayList(); this. = new .(goalX, goalY, 0.0, null, null, null); this. = new .(X, Y, 0.0, null, this., null); this.. = this.; this.. = this.; this..Add(this.); while (this..Count > 0) { if (num2 >= num) { return new (-1, 0); } num2++; .  = (.) this..‰(); if ((. == this..) && (. == this..)) { while ( != null) { list.Insert(0, );  = .; } break; } 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(2); this..Remove(2); this..Š(2); } this..Add(); } if (list.Count == 0) { return new (-1, 0); } . 5 = (.) list[1]; return new (5., 5.); } public  •(int X, int Y, int goalX, int goalY) { if ((X == goalX) && (Y == goalY)) { return null; } int num = (this. * this.) ^ 2; int num2 = 0;   = new (); this. = new .(goalX, goalY, 0.0, null, null, null); this. = new .(X, Y, 0.0, null, this., null); this.. = this.; this.. = this.; this..Add(this.); while (this..Count > 0) { if (num2 >= num) { return null; } num2++; . o = (.) this..‰(); if ((o. == this..) && (o. == this..)) { while (o != null) { ..Push(new (o., o.)); o = o.; } break; } foreach (. 2 in o.(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(2); this..Remove(2); this..Š(2); } this..Add(o); } if (..Count == 0) { return null; } return ; } public bool –(int X, int Y, int goalX, int goalY) { try { if (this.[goalX, goalY] || ((this.[goalX, goalY] != ..) && (this.[goalX, goalY] != ..))) { return false; } return true; } catch { return false; } } public (.[,] squareStates, double[,] squareHeights, bool[,] squareUnitFlags) { this. = squareStates; this. = squareHeights; this. = squareUnitFlags; this. = squareUnitFlags.GetLength(1) - 1; this. = squareUnitFlags.GetLength(0) - 1; } } }