コード例 #1
0
 // 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);
     }
 }
コード例 #2
0
 // 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);
     }
 }
コード例 #3
0
        public SubRotatingRobot(string [] filepath) : base(filepath[0])
        {
            if (filepath.Length != 11)
            {
                return;
            }
            Grid3D grid = new Grid3D(filepath);

            submersible = new Submersible(grid);
        }