KillSign() public static method

public static KillSign ( int x, int y ) : void
x int
y int
return void
Exemplo n.º 1
0
        public static int ReadSign(int i, int j, bool CreateIfMissing = true)
        {
            int num  = Main.tile[i, j].frameX / 18;
            int num1 = Main.tile[i, j].frameY / 18;
            int num2 = i - num % 2;
            int num3 = j - num1;

            if (!Main.tileSign[Main.tile[num2, num3].type])
            {
                Sign.KillSign(num2, num3);
                return(-1);
            }
            int num4 = -1;
            int num5 = 0;

            while (num5 < 1000)
            {
                if (Main.sign[num5] == null || Main.sign[num5].x != num2 || Main.sign[num5].y != num3)
                {
                    num5++;
                }
                else
                {
                    num4 = num5;
                    break;
                }
            }
            if (num4 < 0 && CreateIfMissing)
            {
                int num6 = 0;
                while (num6 < 1000)
                {
                    if (Main.sign[num6] != null)
                    {
                        num6++;
                    }
                    else
                    {
                        num4                 = num6;
                        Main.sign[num6]      = new Sign();
                        Main.sign[num6].x    = num2;
                        Main.sign[num6].y    = num3;
                        Main.sign[num6].text = "";
                        break;
                    }
                }
            }
            return(num4);
        }
Exemplo n.º 2
0
        public static int ReadSign(int i, int j)
        {
            int k   = (int)(Main.tile[i, j].frameX / 18);
            int num = (int)(Main.tile[i, j].frameY / 18);

            while (k > 1)
            {
                k -= 2;
            }
            int num2 = i - k;
            int num3 = j - num;
            int result;

            if (Main.tile[num2, num3].type != 55 && Main.tile[num2, num3].type != 85)
            {
                Sign.KillSign(num2, num3);
                result = -1;
            }
            else
            {
                int num4 = -1;
                for (int l = 0; l < 1000; l++)
                {
                    if (Main.sign[l] != null && Main.sign[l].x == num2 && Main.sign[l].y == num3)
                    {
                        num4 = l;
                        break;
                    }
                }
                if (num4 < 0)
                {
                    for (int m = 0; m < 1000; m++)
                    {
                        if (Main.sign[m] == null)
                        {
                            num4              = m;
                            Main.sign[m]      = new Sign();
                            Main.sign[m].x    = num2;
                            Main.sign[m].y    = num3;
                            Main.sign[m].text = "";
                            break;
                        }
                    }
                }
                result = num4;
            }
            return(result);
        }
Exemplo n.º 3
0
        // Token: 0x0600044E RID: 1102 RVA: 0x0029370C File Offset: 0x0029190C
        public static int ReadSign(int i, int j, bool CreateIfMissing = true)
        {
            int num  = (int)(Main.tile[i, j].frameX / 18);
            int num2 = (int)(Main.tile[i, j].frameY / 18);

            num %= 2;
            int num3 = i - num;
            int num4 = j - num2;

            if (!Main.tileSign[(int)Main.tile[num3, num4].type])
            {
                Sign.KillSign(num3, num4);
                return(-1);
            }
            int num5 = -1;

            for (int k = 0; k < 1000; k++)
            {
                if (Main.sign[k] != null && Main.sign[k].x == num3 && Main.sign[k].y == num4)
                {
                    num5 = k;
                    break;
                }
            }
            if (num5 < 0 & CreateIfMissing)
            {
                for (int l = 0; l < 1000; l++)
                {
                    if (Main.sign[l] == null)
                    {
                        num5              = l;
                        Main.sign[l]      = new Sign();
                        Main.sign[l].x    = num3;
                        Main.sign[l].y    = num4;
                        Main.sign[l].text = "";
                        break;
                    }
                }
            }
            return(num5);
        }