FaultInOurPong  1
model.Ball Class Reference

Public Member Functions

 Ball ()
 Constructor for Ball. More...
 
void setPositionX (int x) throws ArithmeticException
 sets the x position of the ball More...
 
void setPositionY (int y) throws ArithmeticException
 sets the y position of the ball More...
 
int getPositionX ()
 gets the x-position of the ball More...
 
int getPositionY ()
 gets the y-position of the ball More...
 
int getSize ()
 gets the size of the ball More...
 

Private Attributes

int positionX
 
int positionY
 
final int SIZE = 20
 

Constructor & Destructor Documentation

§ Ball()

model.Ball.Ball ( )

Constructor for Ball.

Constructor accepts the x and y position of the ball

Member Function Documentation

§ getPositionX()

int model.Ball.getPositionX ( )

gets the x-position of the ball

Returns
positionX

§ getPositionY()

int model.Ball.getPositionY ( )

gets the y-position of the ball

Returns
positionY

§ getSize()

int model.Ball.getSize ( )

gets the size of the ball

Returns
SIZE

§ setPositionX()

void model.Ball.setPositionX ( int  x) throws ArithmeticException

sets the x position of the ball

Parameters
x-positionof the ball
Exceptions
ArithmeticExceptionball x-position could not be set out of the game frame.

§ setPositionY()

void model.Ball.setPositionY ( int  y) throws ArithmeticException

sets the y position of the ball

Parameters
y-positionof the ball
Exceptions
ArithmeticExceptionball y-position could not be set out of the game frame.

Member Data Documentation

§ positionX

int model.Ball.positionX
private

The X and Y position of a ball on the screen

§ positionY

int model.Ball.positionY
private

§ SIZE

final int model.Ball.SIZE = 20
private

The size of a ball


The documentation for this class was generated from the following file: