public static void NowPositionMatrix_Initialize()
        {
            NowPositionMatrix = new List <List <PositionData> >(4);
            for (int i = 0; i < 4; i++)
            {
                NowPositionMatrix.Add(new List <PositionData>(4));
            }
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    NowPositionMatrix[i].Add(new PositionData());
                }
            }

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    if (i == 0 && j == 0)
                    {
                        NowPositionMatrix[i][j] = new PositionData(Position.Up, Position.Left);
                    }
                    else if (i == 0 && j == 3)
                    {
                        NowPositionMatrix[i][j] = new PositionData(Position.Up, Position.Right);
                    }
                    else if (i == 3 && j == 0)
                    {
                        NowPositionMatrix[i][j] = new PositionData(Position.Down, Position.Left);
                    }
                    else if (i == 3 && j == 3)
                    {
                        NowPositionMatrix[i][j] = new PositionData(Position.Down, Position.Right);
                    }
                    else if (i == 0 && j > 0 && j < 3)
                    {
                        NowPositionMatrix[i][j] = new PositionData(Position.Up, 0);
                    }
                    else if (i == 3 && j > 0 && j < 3)
                    {
                        NowPositionMatrix[i][j] = new PositionData(Position.Down, 0);
                    }
                    else if (i > 0 && i < 3 && j == 3)
                    {
                        NowPositionMatrix[i][j] = new PositionData(0, Position.Right);
                    }
                    else if (i > 0 && i < 3 && j == 0)
                    {
                        NowPositionMatrix[i][j] = new PositionData(0, Position.Left);
                    }
                    else
                    {
                        NowPositionMatrix[i][j] = new PositionData(0, 0);
                    }
                }
            }
        }
Beispiel #2
0
 public GameRectangle(PositionData Position_Value, int RowPosition_Value, int ColPosition_Value)
 {
     nowPosition          = Position_Value;
     RowPosition          = RowPosition_Value;
     colPosition          = ColPosition_Value;
     contains             = false;
     _value               = 0;
     isUpContains         = false;
     isRightContains      = false;
     isDownContains       = false;
     isLeftContains       = false;
     IsPossibleToGenerate = false;
 }