// 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); } }
public SubRotatingRobot(string [] filepath) : base(filepath[0]) { if (filepath.Length != 11) { return; } Grid3D grid = new Grid3D(filepath); submersible = new Submersible(grid); }