public static State keyCheck(State state, LivingThings objects) { if (LivingThings.digit(state.getMaze()[objects.getX()][objects.getY()][0], 6) == 1) { //Key check for (int i = 0; i < state.getKey().Length; i++) { if (state.getKey()[i].samePlace(objects)) { state.setMaze(state.getKey()[i].changeState(state.getMaze())); } } } return(state); }
public bool samePlace(LivingThings thing) { return((this.getX() == thing.getX()) && (this.getY() == thing.getY())); }