1b: chained constructor with default values
This commit is contained in:
parent
cb6b7513aa
commit
d937090e5f
@ -11,10 +11,7 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
|||||||
*/
|
*/
|
||||||
public class CursorModel extends DisplayableElementModel {
|
public class CursorModel extends DisplayableElementModel {
|
||||||
CursorModel() {
|
CursorModel() {
|
||||||
super(false, false, "cursor",
|
super("cursor");
|
||||||
0, false, false,
|
|
||||||
false, null);
|
|
||||||
|
|
||||||
this.loadSprite("cursor");
|
this.loadSprite("cursor");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -49,7 +49,9 @@ public abstract class DisplayableElementModel {
|
|||||||
* @param impactExplosive Object explodes on impact?
|
* @param impactExplosive Object explodes on impact?
|
||||||
* @param animate Object can be animated?
|
* @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) {
|
public DisplayableElementModel(boolean destructible, boolean moving, String spriteName, int priority,
|
||||||
|
boolean impactExplosive, boolean animate, boolean falling, String collideSound,
|
||||||
|
boolean convertible) {
|
||||||
this.moving = moving;
|
this.moving = moving;
|
||||||
this.destructible = destructible;
|
this.destructible = destructible;
|
||||||
this.spriteName = spriteName;
|
this.spriteName = spriteName;
|
||||||
@ -63,10 +65,20 @@ public abstract class DisplayableElementModel {
|
|||||||
|
|
||||||
public DisplayableElementModel(boolean destructible, boolean moving, String spriteName, int priority, boolean impactExplosive, boolean animate, boolean falling, String collideSound) {
|
public DisplayableElementModel(boolean destructible, boolean moving, String spriteName, int priority, boolean impactExplosive, boolean animate, boolean falling, String collideSound) {
|
||||||
this(
|
this(
|
||||||
destructible, moving, spriteName, priority, impactExplosive, animate, falling, collideSound, false
|
destructible, moving, spriteName,
|
||||||
|
priority, impactExplosive, animate,
|
||||||
|
falling, collideSound, false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DisplayableElementModel(final String spriteName){
|
||||||
|
this(
|
||||||
|
false, false, spriteName,
|
||||||
|
0, false, false,
|
||||||
|
false, null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static BoulderModel newBoulderModel() {
|
public static BoulderModel newBoulderModel() {
|
||||||
return DisplayableElementModel.newBoulderModel(false);
|
return DisplayableElementModel.newBoulderModel(false);
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,7 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
|||||||
*/
|
*/
|
||||||
public class DoorModel extends DisplayableElementModel {
|
public class DoorModel extends DisplayableElementModel {
|
||||||
DoorModel() {
|
DoorModel() {
|
||||||
super(false, false, "door",
|
super("door");
|
||||||
0, false, false,
|
|
||||||
false, null);
|
|
||||||
|
|
||||||
this.loadSprite("door");
|
this.loadSprite("door");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,7 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
|||||||
*/
|
*/
|
||||||
public class EmptyModel extends DisplayableElementModel {
|
public class EmptyModel extends DisplayableElementModel {
|
||||||
EmptyModel() {
|
EmptyModel() {
|
||||||
super(false, false, "black",
|
super("black");
|
||||||
0, false, false,
|
|
||||||
false, null);
|
|
||||||
|
|
||||||
this.loadSprite("black");
|
this.loadSprite("black");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user