-
Notifications
You must be signed in to change notification settings - Fork 0
Components
A component is every class that implement the GameComponent interface or extends the AbstractGameComponent class. The interface consists out of the following methods:
draw()
getComponent()
getHeight()
getWidth()
getX()
getY()
setHeight()
setWidth()
setX()
setY()
All this methods must be implemented to create a new component .
Every single component in the BaSliGc library could be decorated with this functions:
For decorating a component with one of the functions above a implementation of the AbstractGameComponent Factory should be used. The factory check if the compoent is already decorated with the same type and if it raise an DecoratedClassException. It also add the component to the Componentlist and the Collisionchecker if a new decoration is created.
To use the factory simply call the creation method of the specific decoration and as a parameter the GameComponent which should be decorated.
createClickable(GameComponent)
createDragable(GameComponent)
createSolid(GameComponent)