Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This class represents a physical body that can have colour.
- */
- package robot.objects;
- import net.phys2d.raw.Body;
- import net.phys2d.raw.shapes.DynamicShape;
- import net.phys2d.raw.shapes.Shape;
- public class ColouredBody extends Body {
- /**
- * Holds the colour of the coloured body.
- */
- private Colour colour;
- /**
- * Creates a new coloured body with the specified colour.
- *
- * @param name The name to assign to the body
- * @param shape The shape describing this body
- * @param m The mass of the body
- */
- public ColouredBody(String name,DynamicShape shape, float m, Colour colour){
- super(name,(Shape) shape,m);
- this.setColour(colour);
- }
- /**
- * Sets the colour of the body.
- * @param colour
- */
- public final void setColour(Colour colour) {
- this.colour = colour;
- }
- /**
- * Returns the colour of the body.
- * @return The colour of the body.
- */
- public Colour getColour(){
- return this.colour;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement