// PreConditions: // PostConditions: allows submersible object to change current 3D grid level to go up public void MoveDown(Submersible R1) { if (R1.IsPoweredup() && (R1.getCurrentLevel() != 10)) { R1.setCurrentLevel(R1.getCurrentLevel() + 1); } }
// PreConditions: // PostConditions: allows submersible object to change current 3D grid level to go down public void MoveUp(Submersible R1) { if (R1.IsPoweredup() && (R1.getCurrentLevel() != 0)) { R1.setCurrentLevel(R1.getCurrentLevel() - 1); } }