コード例 #1
0
 private Cell[] GetCellsBlockPath() =>
 new Cell[3]
 {
     new Cell(1, 0, RandomBall.GetRand()),
     new Cell(1, 1, RandomBall.GetRand()),
     new Cell(0, 1, RandomBall.GetRand())
 };
コード例 #2
0
        public void PathExist()
        {
            Cell startCellWithBall = new Cell(0, 0, RandomBall.GetRand());
            Cell tergetEmptyCell   = new Cell(_defBoardSize - 1, _defBoardSize - 1);

            _board.AddBallToCell(startCellWithBall);

            Assert.IsTrue(_board.IsPathExist(startCellWithBall, tergetEmptyCell));
        }
コード例 #3
0
 public override void Show()
 {
     base.Show();
     giftBox.PlayAnimation("box", true);
     timeEslapsed    = 0f;
     message.Visible = false;
     randomBall      = new RandomBall(GameSettingHelper.GetRandomBall().LargeSpritePath);
     glowing.Visible = false;
     ExtendedGame.AssetManager.PlaySoundEffect("Sounds/snd_gift");
 }
コード例 #4
0
        public void PathNotExist()
        {
            Cell startCellWithBall = new Cell(0, 0, RandomBall.GetRand());
            Cell tergetEmptyCell   = new Cell(_defBoardSize - 1, _defBoardSize - 1);

            Cell[] cellsBlockingPath = GetCellsBlockPath();

            _board.AddBallToCell(startCellWithBall);
            _board.AddBallToCell(cellsBlockingPath);

            Assert.IsFalse(_board.IsPathExist(startCellWithBall, tergetEmptyCell));
        }
コード例 #5
0
        private void AddBallsToBoardCells(int countBalls)
        {
            int counter = 0;

            for (int row = 0; row < _defBoardSize; row++)
            {
                for (int col = 0; col < _defBoardSize; col++)
                {
                    _board[row][col].Ball = RandomBall.GetRand();

                    if (++counter == countBalls)
                    {
                        return;
                    }
                }
            }
        }
コード例 #6
0
    // Use this for initialization

    void Start()
    {
        MakeMeshData();
        //CreateMesh (vertices1, triangles1);
        rb = new RandomBall();
    }
コード例 #7
0
ファイル: DrawPlane.cs プロジェクト: SasanMatinfar/user-study
 void Start()
 {
     tr      = GetComponent <TrailRenderer>();
     tr.time = 1000000;
     rb      = new RandomBall();
 }