public void Bounce(IReadOnlyCollection <IBrick> bricks, IBall ball) { var obstacles = bricks.Cast <IBoundary>().ToList(); Bounce(obstacles, ball, out var degreeType); if (degreeType != DegreeType.None) { ball.CalculateNewDegree(degreeType); } }
private void BounceBall(IBall ball) { if (BounceSmallBall(ball)) { return; } if (BounceBallFromCorner(ball)) { ball.CalculateNewDegree(); return; } if (BounceBigBall(ball)) { ball.CalculateNewDegree(); return; } if (BounceBigBallUnusual(ball)) { return; } }
public void Bounce(IPad pad, IBall ball) { BounceBall(pad, ball, out DegreeType type); ball.CalculateNewDegree(type); }