refactor: utilize NPCType
This commit is contained in:
@ -46,7 +46,7 @@ public class Character extends Entity {
|
||||
super(id, position);
|
||||
solid = false;
|
||||
opaque = true;
|
||||
if(id.type == EntityType.NPC && id.id == 2) {
|
||||
if(id.type == EntityType.NPC && id.id == NPCType.Thanos.getID()) {
|
||||
solid = true; //characters cannot walk into thanos
|
||||
}
|
||||
this.name = name;
|
||||
|
@ -2,7 +2,17 @@ package uulm.teamname.marvelous.gamelibrary.entities;
|
||||
|
||||
/** Specifies the type of an {@link NPC}. */
|
||||
public enum NPCType {
|
||||
Goose,
|
||||
Stan,
|
||||
Thanos
|
||||
Goose(0),
|
||||
Stan(1),
|
||||
Thanos(2);
|
||||
|
||||
private final int id;
|
||||
|
||||
NPCType(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user