1b: default values, constructor with fewer params
This commit is contained in:
parent
7a9956fb63
commit
5bb81a4e65
@ -19,51 +19,19 @@ public abstract class DisplayableElementModel {
|
|||||||
private final boolean destructible;
|
private final boolean destructible;
|
||||||
private final boolean moving;
|
private final boolean moving;
|
||||||
|
|
||||||
private boolean animate;
|
private boolean animate = false;
|
||||||
private boolean impactExplosive;
|
private boolean impactExplosive = false;
|
||||||
private int priority;
|
private int priority = 0;
|
||||||
private boolean falling;
|
private boolean falling = false;
|
||||||
private boolean convertible;
|
private boolean convertible = false;
|
||||||
private String collideSound;
|
private String collideSound = null;
|
||||||
|
|
||||||
private BufferedImage sprite;
|
private BufferedImage sprite;
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor
|
|
||||||
*
|
|
||||||
* @param destructible Object destructible?
|
|
||||||
* @param moving Object is moving?
|
|
||||||
* @param spriteName Object sprite name?
|
|
||||||
* @param priority Object priority?
|
|
||||||
* @param impactExplosive Object explodes on impact?
|
|
||||||
* @param animate Object can be animated?
|
|
||||||
*/
|
|
||||||
public DisplayableElementModel(boolean destructible, boolean moving, String spriteName, int priority,
|
|
||||||
boolean impactExplosive, boolean animate, boolean falling, String collideSound,
|
|
||||||
boolean convertible) {
|
|
||||||
this.moving = moving;
|
|
||||||
this.destructible = destructible;
|
|
||||||
this.spriteName = spriteName;
|
|
||||||
this.animate = animate;
|
|
||||||
this.impactExplosive = impactExplosive;
|
|
||||||
this.priority = priority;
|
|
||||||
this.falling = falling;
|
|
||||||
this.convertible = convertible;
|
|
||||||
this.collideSound = collideSound;
|
|
||||||
}
|
|
||||||
|
|
||||||
private DisplayableElementModel(boolean destructible, boolean moving, String spriteName,
|
|
||||||
int priority, boolean impactExplosive, boolean animate,
|
|
||||||
boolean falling, String collideSound) {
|
|
||||||
this(destructible, moving, spriteName,
|
|
||||||
priority, impactExplosive, animate,
|
|
||||||
falling, collideSound, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DisplayableElementModel(final String spriteName, boolean destructible, boolean moving){
|
public DisplayableElementModel(final String spriteName, boolean destructible, boolean moving){
|
||||||
this(destructible, moving, spriteName,
|
this.spriteName = spriteName;
|
||||||
0, false, false,
|
this.destructible = destructible;
|
||||||
false, null);
|
this.moving = moving;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DisplayableElementModel(final String spriteName){
|
public DisplayableElementModel(final String spriteName){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user