refactor: utilize NPCType

This commit is contained in:
2021-06-01 19:33:48 +02:00
parent e88476eb10
commit 71fc0893a8
3 changed files with 18 additions and 8 deletions

View File

@ -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;

View File

@ -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;
}
}