package view; import model.world.Position; /** * This class is a singleton because we can have only one door * */ public class DoorView extends EntityView { static private DoorView door; private DoorView(Position position) { super(position, "images/door_open.png"); } /** * * @param p the position where the door will be if there is none. * @return The instance of the Door */ static public DoorView getInstance(Position p) { if(door == null) door = new DoorView(p); return door; } }