Commit a97fa503 authored by Thomas Dupriez's avatar Thomas Dupriez
Browse files

Removed EntityDisplayerBank folder

parent 920fc582
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Action;
import core.gamestate.Entity;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
import graphics.guiSkeleton.sprites.Sprite;
/**
* Created by dupriez on 14/11/15.
* Full credits for the code go to Gwendoline, I just created this class and put it in
*
* An implementation of the entityDisplayer class for the pokemon Mentali
*/
public class ChatRoseEntityDisplayer extends EntityDisplayer {
private static final long serialVersionUID = 1L;
//The unique sprite of "Doty the Entity" (it is not animated)
int sprite_num; // le numéro d'image où on en est de l'animation
int sprite_height;
int sprite_width;
int nb_images[]=new int[Action.values().length];
final static int DEFAULT_SPRITE=1;
public ChatRoseEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
sprite_num = 0;
sprite_height = 32;
sprite_width = 32;
nb_images[Action.WALK.ordinal()] = 2;
//QUickFix -Thomas
//0 -> 2
nb_images[Action.ATTACK.ordinal()] = /*0*/2;
nb_images[Action.HIT.ordinal()] = 2;
}
// TODO : change in action. Adaptation for multiaction.
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getChatRose();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
//applying translation
GraphicsMapPoint spriteTopLeftGraphicsMapPoint = entityPositionGraphicsMapPoint.translate(- sprite_width/2, - sprite_height/2);
int direction = entity.getDirection().ordinal();
int x_sprite=0;
int y_sprite = direction * sprite_height;
int nbSprites=DEFAULT_SPRITE;
for(Action act : Action.values()){
if(entity.hasAction(act)){
nbSprites=nb_images[act.ordinal()];
break;
}
}
sprite_num=(sprite_num+1)%(10*nbSprites);
for(int u=0; u<nbSprites; u++) {
if (sprite_num < 10*u) x_sprite = x_sprite + sprite_width;
}
Sprite res = new Sprite((sprite.getSpriteImage()).getSubimage(x_sprite,y_sprite,sprite_height,sprite_width));
return PositionedSprite.PositionSprite(res, spriteTopLeftGraphicsMapPoint);
}
public char getTermSprite(){
return 'C';
}
}
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Action;
import core.gamestate.Entity;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.Sprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
/**
*
* @author Lucas Delcros
* Classe pour diagla (le boss) juste du copy-paste d'autres entites
*/
public class DiaglaEntityDisplayer extends EntityDisplayer{
private static final long serialVersionUID = 1L;
//The unique sprite of "Doty the Entity" (it is not animated)
int sprite_num; // le numéro d'image où on en est de l'animation
int sprite_height;
int sprite_width;
int nb_images[]=new int[Action.values().length];
final static int DEFAULT_SPRITE=1;
public DiaglaEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
sprite_num = 0;
sprite_height = 64;
sprite_width = 64;
nb_images[Action.WALK.ordinal()] = 2;
//QUickFix -Thomas
//0 -> 2
nb_images[Action.ATTACK.ordinal()] = /*0*/2;
nb_images[Action.HIT.ordinal()] = 2;
}
// TODO : change in action. Adaptation for multiaction.
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getDiagla();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
//applying translation
GraphicsMapPoint spriteTopLeftGraphicsMapPoint = entityPositionGraphicsMapPoint.translate(- sprite_width/2, - sprite_height/2);
int direction = entity.getDirection().ordinal();
int x_sprite=0;
int y_sprite = direction * sprite_height;
int nbSprites=DEFAULT_SPRITE;
for(Action act : Action.values()){
if(entity.hasAction(act)){
nbSprites=nb_images[act.ordinal()];
break;
}
}
sprite_num=(sprite_num+1)%(10*nbSprites);
for(int u=0; u<nbSprites; u++) {
if (sprite_num < 10*u) x_sprite = x_sprite + sprite_width;
}
Sprite res = new Sprite((sprite.getSpriteImage()).getSubimage(x_sprite,y_sprite,sprite_height,sprite_width));
return PositionedSprite.PositionSprite(res, spriteTopLeftGraphicsMapPoint);
}
@Override
public char getTermSprite() {
return 'D';
}
}
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Action;
import core.gamestate.Entity;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
import graphics.guiSkeleton.sprites.Sprite;
/**
* Created by hilaire on 05/01/16
* Full credits for the code go to Gwendoline, I just created this class and put it in
*
* An implementation of the entityDisplayer class for the Firebolt
*/
public class FireboltEntityDisplayer extends EntityDisplayer {
private static final long serialVersionUID = 1L;
//The unique sprite of "Doty the Entity" (it is not animated)
int sprite_num; // le numéro d'image où on en est de l'animation
int sprite_height;
int sprite_width;
int nb_images[]=new int[Action.values().length];
final static int DEFAULT_SPRITE=1;
public FireboltEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
sprite_num = 0;
sprite_height = 32;
sprite_width = 32;
nb_images[Action.WALK.ordinal()] = 2;
nb_images[Action.ATTACK.ordinal()] = 2;
nb_images[Action.HIT.ordinal()] = 2;
}
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getFirebolt();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
//applying translation
GraphicsMapPoint spriteTopLeftGraphicsMapPoint = entityPositionGraphicsMapPoint.translate(- sprite_width/2, - sprite_height/2);
int direction = entity.getDirection().ordinal();
int x_sprite=0;
int y_sprite = direction * sprite_height;
int nbSprites=DEFAULT_SPRITE;
for(Action act : Action.values()){
if(entity.hasAction(act)){
nbSprites=nb_images[act.ordinal()];
break;
}
}
sprite_num=(sprite_num+1)%(10*nbSprites);
for(int u=0; u<nbSprites; u++) {
if (sprite_num < 10*u) x_sprite = x_sprite + sprite_width;
}
Sprite res = new Sprite((sprite.getSpriteImage()).getSubimage(x_sprite,y_sprite,sprite_height,sprite_width));
return PositionedSprite.PositionSprite(res, spriteTopLeftGraphicsMapPoint);
}
public char getTermSprite(){
return 'C';
}
}
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Action;
import core.gamestate.Entity;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
import graphics.guiSkeleton.sprites.Sprite;
/**
* Created by hilaire on 05/01/16
* Full credits for the code go to Gwendoline, I just created this class and put it in
*
* An implementation of the entityDisplayer class for the Frostbolt
*/
public class FrostboltEntityDisplayer extends EntityDisplayer {
private static final long serialVersionUID = 1L;
//The unique sprite of "Doty the Entity" (it is not animated)
int sprite_num; // le numéro d'image où on en est de l'animation
int sprite_height;
int sprite_width;
int nb_images[]=new int[Action.values().length];
final static int DEFAULT_SPRITE=1;
public FrostboltEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
sprite_num = 0;
sprite_height = 32;
sprite_width = 32;
nb_images[Action.WALK.ordinal()] = 2;
nb_images[Action.ATTACK.ordinal()] = 2;
nb_images[Action.HIT.ordinal()] = 2;
}
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getFrostbolt();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
//applying translation
GraphicsMapPoint spriteTopLeftGraphicsMapPoint = entityPositionGraphicsMapPoint.translate(- sprite_width/2, - sprite_height/2);
int direction = entity.getDirection().ordinal();
int x_sprite=0;
int y_sprite = direction * sprite_height;
int nbSprites=DEFAULT_SPRITE;
for(Action act : Action.values()){
if(entity.hasAction(act)){
nbSprites=nb_images[act.ordinal()];
break;
}
}
sprite_num=(sprite_num+1)%(10*nbSprites);
for(int u=0; u<nbSprites; u++) {
if (sprite_num < 10*u) x_sprite = x_sprite + sprite_width;
}
Sprite res = new Sprite((sprite.getSpriteImage()).getSubimage(x_sprite,y_sprite,sprite_height,sprite_width));
return PositionedSprite.PositionSprite(res, spriteTopLeftGraphicsMapPoint);
}
public char getTermSprite(){
return 'C';
}
}
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Entity;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
import graphics.guiSkeleton.sprites.Sprite;
/**
* Created by dupriez on 14/11/15.
*
* An implementation of the entityDisplayer class for invisible objects
*
* TODO: Could be optimised (here, the gamePanel draw an invisible point each time, He should not do anything)
*/
public class InvisibleEntityDisplayer extends EntityDisplayer {
private static final long serialVersionUID = 1L;
public InvisibleEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
}
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getInvisible();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
return PositionedSprite.PositionSprite(sprite, entityPositionGraphicsMapPoint);
}
public char getTermSprite(){
return ' ';
}
}
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Action;
import core.gamestate.Entity;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.sprites.SpriteStorage;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.Sprite;
/**
* Created by dupriez on 14/11/15.
* Full credits for the code go to Gwendoline, I just created this class and put it in
*
* An implementation of the entityDisplayer class for the pokemon Ponita
*/
public class PonytaEntityDisplayer extends EntityDisplayer {
private static final long serialVersionUID = 1L;
//The unique sprite of "Doty the Entity" (it is not animated)
int sprite_num; // le numéro d'image où on en est de l'animation
int sprite_height;
int sprite_width;
int nb_images[]=new int[Action.values().length];
final static int DEFAULT_SPRITE=1;
public PonytaEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
sprite_num = 0;
sprite_height = 32;
sprite_width = 32;
nb_images[Action.WALK.ordinal()] = 2;
//QUickFix -Thomas
//0 -> 2
nb_images[Action.ATTACK.ordinal()] = /*0*/2;
nb_images[Action.HIT.ordinal()] = 2;
}
// TODO : change in action. Adaptation for multiaction.
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getPonyta();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
//applying translation
GraphicsMapPoint spriteTopLeftGraphicsMapPoint = entityPositionGraphicsMapPoint.translate(- sprite_width/2, - sprite_height/2);
int direction = entity.getDirection().ordinal();
int x_sprite=0;
int y_sprite = direction * sprite_height;
int nbSprites=DEFAULT_SPRITE;
for(Action act : Action.values()){
if(entity.hasAction(act)){
nbSprites=nb_images[act.ordinal()];
break;
}
}
sprite_num=(sprite_num+1)%(10*nbSprites);
for(int u=0; u<nbSprites; u++) {
if (sprite_num < 10*u) x_sprite = x_sprite + sprite_width;
}
Sprite res = new Sprite((sprite.getSpriteImage()).getSubimage(x_sprite,y_sprite,sprite_height,sprite_width));
return PositionedSprite.PositionSprite(res, spriteTopLeftGraphicsMapPoint);
}
@Override
public char getTermSprite() {
return 'P';
}
}
package graphics.guiSkeleton.entityDisplayer.entityDisplayerBank;
import core.gamestate.Entity;
import core.gamestate.Action;
import graphics.graphical_utility.GraphicalBridgeConfiguration;
import graphics.guiSkeleton.mapManagement.GraphicsMap;
import graphics.guiSkeleton.entityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.mapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.mapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
import graphics.guiSkeleton.sprites.Sprite;
/**
* Created by dupriez on 14/11/15.
* Full credits for the code go to Gwendoline, I just created this class and put it in
*
* An implementation of the entityDisplayer class for the pokemon Ronflex
*/
public class RonflexEntityDisplayer extends EntityDisplayer {
private static final long serialVersionUID = 1L;
int sprite_num; // le numéro d'image où on en est de l'animation
int sprite_height;
int sprite_width;
int nb_images[]=new int[Action.values().length];
final static int DEFAULT_SPRITE=1;
public RonflexEntityDisplayer(Entity associatedEntity) {
super(associatedEntity);
sprite_num = 0;
sprite_height = 32;
sprite_width = 32;
nb_images[Action.WALK.ordinal()] = 2;
nb_images[Action.ATTACK.ordinal()] = /*0*/2;
nb_images[Action.HIT.ordinal()] = 2;
}
// TODO : change in action. Adaptation for multiaction.
@Override
public PositionedSprite getPositionedSprite(GraphicsMap graphicsMap) {
Sprite sprite = SpriteStorage.getInstance().getRonflex();
Entity entity = getAssociatedEntity();
GraphicsMapPoint entityPositionGraphicsMapPoint = GraphicalBridgeConfiguration.makeMapPointFromCoreCoordinates(entity.getX(), entity.getY());
//applying translation
GraphicsMapPoint spriteTopLeftGraphicsMapPoint = entityPositionGraphicsMapPoint.translate(- sprite_width/2, - sprite_height/2);
int direction = entity.getDirection().ordinal();
int x_sprite=0;
int y_sprite = direction * sprite_height;
int nbSprites=DEFAULT_SPRITE;
for(Action act : Action.values()){
if(entity.hasAction(act)){
nbSprites=nb_images[act.ordinal()];
break;
}
}
sprite_num=(sprite_num+1)%(10*nbSprites);
for(int u=0; u<nbSprites; u++) {
if (sprite_num < 10*u) x_sprite = x_sprite + sprite_width;
}
Sprite res = new Sprite((sprite.getSpriteImage()).getSubimage(x_sprite,y_sprite,sprite_height,sprite_width));
return PositionedSprite.PositionSprite(res, spriteTopLeftGraphicsMapPoint);
}
public char getTermSprite(){
return 'R';
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment