Beispiel #1
0
    public static void Main()
    {
        int n;

        @int n2 = new @int();

        n2.show();

        where w = new where ();
    }
Beispiel #2
0
        private static void Main()
        {
            @bool          b  = false;
            @string        s  = "hello";
            @int           i  = 12;
            EmptyInterface eb = b;
            EmptyInterface ai = (@int)12;

            //@string y1 = 0x266c;

            //char x = '\x266c';

            //Console.WriteLine(x);

            Main1();
            Main2();
            Main3();
            Main4();
            Main5();
            Main6();
            Main7();
            ref int value = ref Main8();
Beispiel #3
0
 public _Main_s_type(@int i = default, @bool b = default)
 {
     this.i = i;
     this.b = b;
 }
Beispiel #4
0
 public Vertex(@int X = default, @int Y = default)
 {
     this.X = X;
     this.Y = Y;
 }
Beispiel #5
0
 public Account(User User, @int MyFloat)
 {
     this.User    = User;
     this.MyFloat = MyFloat;
 }
Beispiel #6
0
 /* comment after function
  *  Hello!
  */
 // Test function
 private static void test(@int a, int16 b, slice <@byte> c)
 {
     fmt.Println(a);
 }
Beispiel #7
0
 /* comment - another */
 public static @int DoIt(@string b, @int _p0)
 { // here
     fmt.Println(b);
     return(0);
 }
Beispiel #8
0
 private static (message, err) noComment(@string ya, @int andAnother, @string _p0)
 {
 }
Beispiel #9
0
    /// <summary>
    /// 寻路
    /// </summary>
    /// <param name="start"></param>
    /// <param name="end"></param>
    /// <param name="limit"></param>
    /// <returns></returns>
    public static List <Coordinate> FindPath(Coordinate start, Coordinate end, int limit = 5000)
    {
        var path = new List <Coordinate>();

        var openSet = new HashSet <Coordinate>();

        minHeap.Clear();

        var closeSet = new HashSet <Coordinate>();

        var curNode = new @int(start);

        closeSet.Add(curNode.Coordinate);

        var loopNum = 0;

        while (curNode != null && curNode.Coordinate != end)
        {
            loopNum++;

            if (loopNum > limit)
            {
                Debug.Log("死循环");
                return(new List <Coordinate>());
            }

            for (var i = 0; i < 4; i++)
            {
                var nCoord = curNode.Coordinate.GetNeightbour(i);

                var grid = MapAreaMgr.Instance.GetGrid(nCoord);

                if (grid != null && !grid.IsWall && !closeSet.Contains(nCoord))
                {
                    var g = curNode.G + (i < 4 ? 10 : 14);

                    var h = (int)(nCoord.Distance(end) * 10);

                    if (!openSet.Contains(nCoord))
                    {
                        var node = new @int(nCoord)
                        {
                            G = g,

                            H = h,

                            Parent = curNode,
                        };

                        openSet.Add(nCoord);

                        minHeap.Add(node);
                    }
                }
            }

            curNode = minHeap.GetMin();

            closeSet.Add(curNode.Coordinate);
        }

        while (curNode != null)
        {
            path.Add(curNode.Coordinate);

            curNode = curNode.Parent;
        }

        path.Reverse();

        return(path);
    }
Beispiel #10
0
 public static @bool Less(this PeopleByShoeSize p, @int i, @int j)
 {
     return(p[i].ShoeSize < p[j].ShoeSize);
 }
Beispiel #11
0
 public static void Swap(this PeopleByShoeSize p, @int i, @int j)
 {
     p[i] = p[j];
     p[j] = p[i];
 }
Beispiel #12
0
 public DoDad(@int I, @string O, @string[][] a)
 {
     this.I = I;
     this.O = O;
     this.a = a;
 }
Beispiel #13
0
 public span(@int start, @int end, @int another)
 {
     this.start   = start;
     this.end     = end;
     this.another = another;
 }
 public Person(@string Name, @int Age, float32 ShoeSize)
 {
     this.Name     = Name;
     this.Age      = Age;
     this.ShoeSize = ShoeSize;
 }
Beispiel #15
0
 public User(@int Id, @string Name)
 {
     this.Id   = Id;
     this.Name = Name;
 }
Beispiel #16
0
 private static void f(@int y)
 {
     fmt.Print(y);
 }
Beispiel #17
0
 public Vertex(@int X, @int Y, DoDad DoDad)
 {
     this.X          = X;
     this.Y          = Y;
     this.m_DoDadRef = new Ref <DoDad>(DoDad);
 }
Beispiel #18
0
 public bool Contains(@int n)
 {
     return(haseSet.Contains(n));
 }