示例#1
0
    ////////////////-ready------------------------------------
    public override void _Ready()
    {
        PiecePath = new int[Global_I.MAX_DICE_FACES];
        for (int i = 0; i < PiecePath.Length; i++)
        {
            PiecePath[i] = -1;
        }
        CellD.Resize(B_I.Length);
        G2 = (Global_I)GetNode("/root/GlobalI");
        for (int i = 0; i < B_I.Length; i++)
        {
            B_I[i].Pie     = new PackedPiece[Global_I.MAX_PIECE];
            B_I[i].PlCount = 0;
        }

        B_I[72].PlCount = 16;
        for (int i = 0, k = 0; i < 4; i++)
        {
            for (int j = 0; j < 4; j++, k++)
            {
                B_I[72].Pie[k].Player = i;
                B_I[72].Pie[k].Piece  = j;
                //string lol = B_I[72].Pie[k].Player + " " + B_I[72].Pie[k].Piece;
                //GD.Print(lol);
            }
        }

        DebugBoard.Resize(15 * 15 + 4);
        Draw_DebugBoard();
        DebugTheBoard();
    }
示例#2
0
        private void SetComputerStep(GameCell Cell)
        {
            int[,] WinCells;
            WinCells = new int[x, y];
            if (Cell.WinMode == WinMode.None)
            {
                WaveCells(Cell.x, Cell.y, WinCells);
                GameCell Cell1, CellD, CellL;

                for (int iy = 0; iy <= y - 1; iy++)
                {
                    for (int ix = 0; ix <= x - 1; ix++)
                    {
                        if (WinCells[ix, iy] == 1)
                        {
                            Cell1 = fileldArray[ix, iy];
                            CellD = fileldArray[ix, iy + 1];
                            CellL = fileldArray[ix + 1, iy];
                            Cell1.SetCell(WinMode.Computer);
                            Cell1.SetCell((Cell1.Horizontal == CellMode.Empty ? CellMode.Computer : Cell1.Horizontal), (Cell1.Vertical == CellMode.Empty ? CellMode.Computer : Cell1.Vertical));
                            CellD.SetCell((CellD.Horizontal == CellMode.Empty ? CellMode.Computer : CellD.Horizontal), CellD.Vertical);
                            CellL.SetCell(CellL.Horizontal, (CellL.Vertical == CellMode.Empty ? CellMode.Computer : CellL.Vertical));
                        }
                    }
                }
            }
        }