merge Character tile into master #7
@@ -1,11 +1,14 @@
|
|||||||
package netwerkprog.game.util.game;
|
package netwerkprog.game.util.game;
|
||||||
|
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public abstract class GameCharacter extends Actor implements Comparable<GameCharacter> {
|
public abstract class GameCharacter extends Actor implements Comparable<GameCharacter> {
|
||||||
@@ -14,7 +17,6 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
|
|||||||
protected HashSet<Ability> abilities;
|
protected HashSet<Ability> abilities;
|
||||||
protected boolean override;
|
protected boolean override;
|
||||||
protected TextureRegion textureRegion;
|
protected TextureRegion textureRegion;
|
||||||
protected SpriteBatch batch;
|
|
||||||
|
|
||||||
public GameCharacter(String name, Faction faction, TextureRegion textureRegion, Ability... abilities) {
|
public GameCharacter(String name, Faction faction, TextureRegion textureRegion, Ability... abilities) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -22,7 +24,6 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
|
|||||||
this.abilities = new HashSet<>(Arrays.asList(abilities));
|
this.abilities = new HashSet<>(Arrays.asList(abilities));
|
||||||
this.override = false;
|
this.override = false;
|
||||||
this.textureRegion = textureRegion;
|
this.textureRegion = textureRegion;
|
||||||
batch = new SpriteBatch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAbilities(Ability ability) {
|
public void addAbilities(Ability ability) {
|
||||||
@@ -45,12 +46,6 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
|
|||||||
this.textureRegion = textureRegion;
|
this.textureRegion = textureRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(float x, float y) {
|
|
||||||
batch.begin();
|
|
||||||
batch.draw(this.textureRegion, x, y);
|
|
||||||
batch.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user