// Listing 10.1. Mechanizm tłumaczący PUMT — definicja klasy situation

 //ACTIONS: SECTION 2
  179    class situation{
  180    
  181       public room Area;
  182       int ActionNum = 0;
  183       public ArrayList<action>  Actions;
  184       action RobotAction;
  185       public situation(softbot  Bot)
  186       {
  187          RobotAction = new action();
  188          Actions = new ArrayList<action>();
  189          scenario_action1 Task1 = new scenario_action1(Bot);
  190          scenario_action2 Task2 = new scenario_action2(Bot);
  191          Actions.add(Task1);
  192          Actions.add(Task2);
  193          Area = new room();
  194    
  195       }
  196       public void nextAction() throws Exception
  197       {
  198              
  199          if(ActionNum < Actions.size()){
  200             RobotAction = Actions.get(ActionNum);
  201          }
  202          RobotAction.task(); 
  203          ActionNum++;
  204                 
  205            
  206       }
  207       public int numTasks()
  208       {
  209          return(Actions.size());
  210      
  211       }
  212    
  213    }
  214  
