71104
19-05-2006, 15:36
cioč dico, non so se vi eravate vagamente resi conto della schifezza/porcheria che era presente fino a poco fa nel costruttore di AbstractDroppable...
protected AbstractDroppable(EngineInterface engine, DroppableType type,
DroppableColor color, int animationDelay)
{
String appendedColor = java.io.File.separator + color.getName();
String textureName = DROPPABLE_PATH.concat(type.getName()).concat(
appendedColor);
if (type.isDynamite())
{
textureName = DROPPABLE_PATH.concat(ADVANCED).concat(
type.getName());
}
sprite = new Sprite(0, 0, engine.createImage(textureName));
sprite.setSize(DROPPABLE_SIZE, DROPPABLE_SIZE);
this.type = type;
this.color = color;
addFrame(0, 0, animationDelay);
}
NAUSEA +O(
l'ho corretto:
protected AbstractDroppable(EngineInterface engine, DroppableType type,
DroppableColor color, int animationDelay)
{
sprite = new Sprite(0, 0, engine.createImage(getTextureName(type, color)));
sprite.setSize(DROPPABLE_SIZE, DROPPABLE_SIZE);
this.type = type;
this.color = color;
addFrame(0, 0, animationDelay);
}
protected String getTextureName(DroppableType type, DroppableColor color)
{
String appendedColor = java.io.File.separator + color.getName();
return DROPPABLE_PATH.concat(type.getName()).concat(appendedColor);
}
public final class Dynamite extends AbstractDroppable
{
.
.
.
protected String getTextureName(DroppableType type, DroppableColor color)
{
return DROPPABLE_PATH.concat(ADVANCED).concat(type.getName());
}
protected AbstractDroppable(EngineInterface engine, DroppableType type,
DroppableColor color, int animationDelay)
{
String appendedColor = java.io.File.separator + color.getName();
String textureName = DROPPABLE_PATH.concat(type.getName()).concat(
appendedColor);
if (type.isDynamite())
{
textureName = DROPPABLE_PATH.concat(ADVANCED).concat(
type.getName());
}
sprite = new Sprite(0, 0, engine.createImage(textureName));
sprite.setSize(DROPPABLE_SIZE, DROPPABLE_SIZE);
this.type = type;
this.color = color;
addFrame(0, 0, animationDelay);
}
NAUSEA +O(
l'ho corretto:
protected AbstractDroppable(EngineInterface engine, DroppableType type,
DroppableColor color, int animationDelay)
{
sprite = new Sprite(0, 0, engine.createImage(getTextureName(type, color)));
sprite.setSize(DROPPABLE_SIZE, DROPPABLE_SIZE);
this.type = type;
this.color = color;
addFrame(0, 0, animationDelay);
}
protected String getTextureName(DroppableType type, DroppableColor color)
{
String appendedColor = java.io.File.separator + color.getName();
return DROPPABLE_PATH.concat(type.getName()).concat(appendedColor);
}
public final class Dynamite extends AbstractDroppable
{
.
.
.
protected String getTextureName(DroppableType type, DroppableColor color)
{
return DROPPABLE_PATH.concat(ADVANCED).concat(type.getName());
}