コード例 #1
0
 internal SimpleCellInfo(MapData MapData, MapPoint OriginPoint, SimpleCellInfo class13_1, MapPoint mapPoint_2)
 {
     this.int_0         = 0;
     this.int_1         = 0;
     this.v_OriginPoint = OriginPoint;
     this.class13_0     = class13_1;
     this.int_1         = (mapPoint_2.DistanceToCell(OriginPoint) * 5);
     this.int_0         = (class13_1.int_0 + 10);
     if (((class13_1.class13_0 != null)))
     {
         int num2 = class13_1.class13_0.v_OriginPoint.OrientationTo(class13_1.v_OriginPoint);
         int num3 = class13_1.v_OriginPoint.OrientationTo(OriginPoint);
         int num  = Math.Abs(Convert.ToInt32((num2 - num3)));
         if ((num != 0))
         {
             this.int_0 = (this.int_0 + 5);
             if (((num != 1) && (num != 7)))
             {
                 this.int_0 = (this.int_0 + 50);
             }
         }
         if ((MapData.Data.Cells[OriginPoint.CellId].Speed == 2))
         {
             this.int_0 = (this.int_0 - 8);
         }
     }
 }
コード例 #2
0
        private MovementPath method_3(SimpleCellInfo class13_0)
        {
            List <MapPoint> range  = new List <MapPoint>();
            SimpleCellInfo  class2 = class13_0;

            while (class2.v_OriginPoint.CellId != this.MapPoint_FromCell.CellId)
            {
                class2 = class2.class13_0;
                range.Add(class2.v_OriginPoint);
            }
            range.Reverse();
            range.Add(class13_0.v_OriginPoint);
            if (this.v_MouvementPoints != -1)
            {
                range = range.GetRange(0, (((this.v_MouvementPoints + 1) > range.Count) ? range.Count : (this.v_MouvementPoints + 1)));
            }
            MovementPath path = new MovementPath {
                CellStart = this.MapPoint_FromCell, CellEnd = range[(range.Count - 1)]
            };
            int num = (range.Count - 2);
            int i   = 0;

            while (i <= num)
            {
                PathElement item = new PathElement {
                    Cell = range[i], Orientation = range[i].OrientationTo(range[(i + 1)])
                };
                path.Cells.Add(item);
                i += 1;
            }
            path.Compress();
            return(path);
        }
コード例 #3
0
        public MovementPath FindPath(int FromCell, int ToCell)
        {
            SimpleCellInfo class3 = null;

            this.MapPoint_FromCell = new MapPoint(FromCell);
            this.MapPoint_ToCell   = new MapPoint(ToCell);
            SimpleCellInfo item = new SimpleCellInfo(this.MapPoint_FromCell);

            this.list_0.Add(item);
Label_00BF:
            class3 = this.method_0();
            if (class3 != null)
            {
                this.list_0.Remove(class3);
                this.list_1.Add(class3);
                if (class3.v_OriginPoint.CellId == ToCell)
                {
                    return(this.method_3(class3));
                }
                //INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
                //				MapPoint point = null;
                foreach (MapPoint point in class3.method_0(this.IsInFight))
                {
                    if (Convert.ToBoolean(this.method_2(point.CellId)))
                    {
                        this.method_1(new SimpleCellInfo(this.MapData, point, class3, this.MapPoint_ToCell));
                    }
                }
                goto Label_00BF;
            }
            return(null);
        }
コード例 #4
0
ファイル: SimpleCellInfo.cs プロジェクト: Sadikk/BlueSheep
 internal SimpleCellInfo(MapData MapData, MapPoint OriginPoint, SimpleCellInfo class13_1, MapPoint mapPoint_2)
 {
     this.int_0 = 0;
     this.int_1 = 0;
     this.v_OriginPoint = OriginPoint;
     this.class13_0 = class13_1;
     this.int_1 = (mapPoint_2.DistanceToCell(OriginPoint) * 5);
     this.int_0 = (class13_1.int_0 + 10);
     if (((class13_1.class13_0 != null)))
     {
         int num2 = class13_1.class13_0.v_OriginPoint.OrientationTo(class13_1.v_OriginPoint);
         int num3 = class13_1.v_OriginPoint.OrientationTo(OriginPoint);
         int num = Math.Abs(Convert.ToInt32((num2 - num3)));
         if ((num != 0))
         {
             this.int_0 = (this.int_0 + 5);
             if (((num != 1) && (num != 7)))
             {
                 this.int_0 = (this.int_0 + 50);
             }
         }
         if ((MapData.Data.Cells[OriginPoint.CellId].Speed == 2))
         {
             this.int_0 = (this.int_0 - 8);
         }
     }
 }
コード例 #5
0
ファイル: SimplePathfinder.cs プロジェクト: Sadikk/BlueSheep
 public MovementPath FindPath(int FromCell, int ToCell)
 {
     SimpleCellInfo class3 = null;
     this.MapPoint_FromCell = new MapPoint(FromCell);
     this.MapPoint_ToCell = new MapPoint(ToCell);
     SimpleCellInfo item = new SimpleCellInfo(this.MapPoint_FromCell);
     this.list_0.Add(item);
     Label_00BF:
     class3 = this.method_0();
     if (class3 != null)
     {
         this.list_0.Remove(class3);
         this.list_1.Add(class3);
         if (class3.v_OriginPoint.CellId == ToCell)
         {
             return this.method_3(class3);
         }
         //INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
         //				MapPoint point = null;
         foreach (MapPoint point in class3.method_0(this.IsInFight))
         {
             if (Convert.ToBoolean(this.method_2(point.CellId)))
             {
                 this.method_1(new SimpleCellInfo(this.MapData, point, class3, this.MapPoint_ToCell));
             }
         }
         goto Label_00BF;
     }
     return null;
 }
コード例 #6
0
ファイル: SimpleCellInfo.cs プロジェクト: Sadikk/BlueSheep
 // Methods
 internal SimpleCellInfo(MapPoint OriginPoint)
 {
     this.int_0 = 0;
     this.int_1 = 0;
     this.v_OriginPoint = OriginPoint;
     this.class13_0 = null;
     this.int_0 = 0;
 }
コード例 #7
0
        private SimpleCellInfo method_0()
        {
            SimpleCellInfo class2 = null;

            //INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
            //			SimpleCellInfo class3 = null;
            foreach (SimpleCellInfo class3 in this.list_0)
            {
                if ((class2 == null) || ((class2.int_0 + class2.int_1) > (class3.int_0 + class3.int_1)))
                {
                    class2 = class3;
                }
            }
            return(class2);
        }
コード例 #8
0
 private void method_1(SimpleCellInfo class13_0)
 {
     //INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
     //			SimpleCellInfo class2 = null;
     foreach (SimpleCellInfo class2 in this.list_0)
     {
         if ((class2.v_OriginPoint.CellId == class13_0.v_OriginPoint.CellId) && ((class2.int_0 + class2.int_1) <= (class13_0.int_0 + class13_0.int_1)))
         {
             return;
         }
     }
     //INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
     //			SimpleCellInfo class3 = null;
     foreach (SimpleCellInfo class3 in this.list_1)
     {
         if ((class3.v_OriginPoint.CellId == class13_0.v_OriginPoint.CellId) && ((class3.int_0 + class3.int_1) <= (class13_0.int_0 + class13_0.int_1)))
         {
             return;
         }
     }
     this.list_0.Add(class13_0);
 }
コード例 #9
0
ファイル: SimplePathfinder.cs プロジェクト: Sadikk/BlueSheep
 private MovementPath method_3(SimpleCellInfo class13_0)
 {
     List<MapPoint> range = new List<MapPoint>();
     SimpleCellInfo class2 = class13_0;
     while (class2.v_OriginPoint.CellId != this.MapPoint_FromCell.CellId)
     {
         class2 = class2.class13_0;
         range.Add(class2.v_OriginPoint);
     }
     range.Reverse();
     range.Add(class13_0.v_OriginPoint);
     if (this.v_MouvementPoints != -1)
     {
         range = range.GetRange(0, (((this.v_MouvementPoints + 1) > range.Count) ? range.Count : (this.v_MouvementPoints + 1)));
     }
     MovementPath path = new MovementPath { CellStart = this.MapPoint_FromCell, CellEnd = range[(range.Count - 1)] };
     int num = (range.Count - 2);
     int i = 0;
     while (i <= num)
     {
         PathElement item = new PathElement { Cell = range[i], Orientation = range[i].OrientationTo(range[(i + 1)]) };
         path.Cells.Add(item);
         i += 1;
     }
     path.Compress();
     return path;
 }
コード例 #10
0
ファイル: SimplePathfinder.cs プロジェクト: Sadikk/BlueSheep
 private void method_1(SimpleCellInfo class13_0)
 {
     //INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
     //			SimpleCellInfo class2 = null;
     foreach (SimpleCellInfo class2 in this.list_0)
     {
         if ((class2.v_OriginPoint.CellId == class13_0.v_OriginPoint.CellId) && ((class2.int_0 + class2.int_1) <= (class13_0.int_0 + class13_0.int_1)))
         {
             return;
         }
     }
     //INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
     //			SimpleCellInfo class3 = null;
     foreach (SimpleCellInfo class3 in this.list_1)
     {
         if ((class3.v_OriginPoint.CellId == class13_0.v_OriginPoint.CellId) && ((class3.int_0 + class3.int_1) <= (class13_0.int_0 + class13_0.int_1)))
         {
             return;
         }
     }
     this.list_0.Add(class13_0);
 }