Advertisement
Iamlugano

Untitled

Oct 10th, 2011
3,266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Eiffel 1.15 KB | None | 0 0
  1. note
  2.     description: "Creating new objects for Zurich."
  3.  
  4. class
  5.     OBJECT_CREATION
  6.  
  7. inherit
  8.     ZURICH_OBJECTS
  9.  
  10. feature -- Explore Zurich
  11.  
  12.     explore
  13.             -- Create new objects for Zurich.
  14.  
  15.         do
  16.             --creating first building
  17.             create p1.make (300, 50)
  18.             create p2.make (400, 0)
  19.             create Hauptgebaeude.make ("Raemistrasse 101", p1, p2)
  20.             --creating another building
  21.             create p3.make (300, -1400)
  22.             create p4.make (350, -1450)
  23.             create Oper.make ("Opernstrasse 1", p3, p4)
  24.             --creating some legs for a route, and linking them
  25.             create leg1.make (Polyterrasse, Central, Polybahn)
  26.             create leg2.make (Central, Zurich.station ("Paradeplatz"), Zurich.line (6))
  27.             create leg3.make (Zurich.station ("Paradeplatz"), Zurich.station ("Opernhaus"), Zurich.line (2))
  28.             create route1.make (leg1)
  29.             route1.append_leg (leg2)
  30.             route1.append_leg (leg3)
  31.             --adding buildings and route to Zurich and displaying them on the map
  32.             Zurich_map.animate
  33.             Zurich.add_building (Hauptgebaeude)
  34.             Zurich.add_building (Oper)
  35.             Zurich.add_route (route1)
  36.  
  37.         end
  38.  
  39.     Hauptgebaeude, Oper: BUILDING
  40.     p1, p2, p3, p4: VECTOR
  41.     leg1, leg2, leg3: LEG
  42.     route1: ROUTE
  43.  
  44. end
  45.  
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement