// Listing 9.4. Mechanizm tłumaczący PUMT — klasy situation, x_location, room i something


    1	  class x_location{
    2	     public int X;
    3	     public int Y;
    4	     public x_location()
    5	     {
    6	      
    7	         X = 0;
    8	         Y = 0;
    9	     } 
   10	  
   11	  }
   12	
   13	
   14	  class something{
   15	     x_location Location;
   16	     int Color;
   17	     public something()
   18	     {
   19	         Location = new x_location();
   20	         Location.X = 0;
   21	         Location.Y = 0;
   22	         Color = 0;
   23	     }
   24	     public void setLocation(int X,int Y)
   25	     {
   26	  
   27	         Location.X = X;
   28	         Location.Y = Y;
   29	  
   30	     }
   31	     public int getXLocation()
   32	     {
   33	         return(Location.X);
   34	     }    
   35	  
   36	     public int getYLocation()
   37	     {
   38	         return(Location.Y);
   39	  
   40	     }
   41	  
   42	     public void setColor(int X)
   43	     {
   44	  
   45	         Color = X;
   46	     }
   47	  
   48	     public int getColor()
   49	     {
   50	        return(Color);
   51	     }     
   52	  
   53	  }
   54	
   55	  class room{
   56	     protected int Length = 300;
   57	     protected int Width = 200;
   58	     protected int Area;
   59	     public something SomeObject;
   60	
   61	     public  room() 
   62	     {
   63	         SomeObject =  new something();
   64	         SomeObject.setLocation(20,50);
   65	     }  
   66	   
   67	     
   68	     public int  area()  
   69	     {
   70	         Area = Length * Width;
   71	         return(Area); 
   72	     }
   73	
   74	     public  int length()
   75	     {
   76	      
   77	         return(Length);
   78	     }
   79	
   80	     public int width()
   81	     {
   82	
   83	         return(Width);
   84	     }
   85	  }
   86	
   87	  class situation{
   88	
   89	     public room TestRoom;
   90	     public situation()
   91	     {
   92	         TestRoom = new room();
   93	
   94	     }
   95	  }
