コード例 #1
0
 private bool TryMove(BlockController sender, BlockPoint newPoint)
 {
     if (_blocks[newPoint.X, newPoint.Y] == null)
     {
         _blocks[sender.Position.X, sender.Position.Y] = null;
         _blocks[newPoint.X, newPoint.Y] = sender;
         sender.AcceptMove();
     }
 }
コード例 #2
0
 private void OnClickMove(BlockController sender, Side side, BlockPoint newPoint)
 {
     if (_blocks[newPoint.X, newPoint.Y] == null && AllowClickMoved(sender))
     {
         sender.Moved     = true;
         sender.IsStarted = false;
         sender.AcceptMove();
         CallMoveClick();
     }
 }
コード例 #3
0
 private void OnBlockTryMove(BlockController sender, Side side, BlockPoint newPoint)
 {
     if (_blocks[newPoint.X, newPoint.Y] == null)
     {
         _blocks[sender.Position.X, sender.Position.Y] = null;
         _blocks[newPoint.X, newPoint.Y] = sender;
         sender.AcceptMove();
         _moveCount++;
     }
 }
コード例 #4
0
 private bool OnClickMove(BlockController sender, BlockPoint newPoint)
 {
     if (_blocks[newPoint.X, newPoint.Y] == null && AllowClickMoved(sender))
     {
         sender.Moved     = true;
         sender.IsStarted = false;
         sender.AcceptMove();
         return(true);
     }
     return(false);
 }
コード例 #5
0
        private bool ReverceMove(BlockController sender, BlockPoint newPoint)
        {
            int x = newPoint.X;
            int y = newPoint.Y;

            if (x < 0 || x >= _weightGamePole || y < 0 || y >= _heightGamePole)
            {
                _blocksGenerator.SetBlock(sender);
                MoveBall();
                return(false);
            }

            var nextBlock = _blocks[x, y];

            if (nextBlock != null && nextBlock.IsStarted)
            {
                nextBlock.Reverce();
                _changedBlock.Add(sender, newPoint);
                sender.AcceptMove();
                return(true);
            }
            return(false);
        }