Constructor and Description |
---|
Amoeba(java.lang.String layout,
char displayChar)
Amoeba constructor is mad by string layout that we will read the shape
of this amoeba and the char displayChar that is the repr of this shape.
|
Modifier and Type | Method and Description |
---|---|
char |
getDisplayChar()
getDisplayChar() get the displayChar fields.
|
int |
getHeight()
getHeight() get the height fields.
|
Rotation |
getRotation()
getRotation get the actual rotation of the shape
|
int |
getWidth()
getWidth() get the width fields.
|
boolean |
isFilledAt(int row,
int col)
isFilledAt(r,c) check if this point is in the shape bound and check
if this spot is filled and no.
|
void |
rotateCW()
rotateCW rotate this shape clockwise by 90 degrees and creates a new shape
that has had a rotation of the shape.
|
void |
setDisplayChar(char c)
Set how the shape will be displayed in order to change other than just seting
the diplayChar=c I will update each position that had the previous displaychar c
with the new char c in 2dlayout of amoeba.
|
java.lang.String |
toString()
toString will create a string repr that we like for our shape that follows
this pattern.
|
public Amoeba(java.lang.String layout, char displayChar)
public int getHeight()
public int getWidth()
public char getDisplayChar()
getDisplayChar
in interface Shape
public void setDisplayChar(char c)
setDisplayChar
in interface Shape
public void rotateCW()
public Rotation getRotation()
getRotation
in interface Shape
public boolean isFilledAt(int row, int col)
isFilledAt
in interface Shape
public java.lang.String toString()