java.lang.Object Building
public class Building
This class represents a building in the gorilla game. A building knows its position in the game, its dimensions and its color.
Constructor Summary | |
---|---|
Building(int left,
int bottom,
int height,
int width,
java.awt.Color color)
Makes a new building |
Method Summary | |
---|---|
int |
getBottom()
Returns the distance of the bottom left corner of the building from the bottom edge of the game area. |
java.awt.Color |
getColor()
Returns the color of the building. |
int |
getHeight()
Returns the height of the building. |
int |
getLeft()
Returns the distance of the bottom left corner of the building from the left edge of the game area. |
int |
getWidth()
Returns the width of the building. |
java.lang.String |
toString()
Returns information about this building in String form. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Building(int left, int bottom, int height, int width, java.awt.Color color)
left
- The distance of the bottom left corner of the building from
the left edge of the game area.bottom
- The distance of the bottom left corner of the building from
the bottom edge of the game area.height
- The height of the building.width
- The width of the building.color
- The color of the buildingMethod Detail |
---|
public int getLeft()
public int getBottom()
public int getHeight()
public int getWidth()
public java.awt.Color getColor()
public java.lang.String toString()
toString
in class java.lang.Object