Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- note
- description: "Creating new objects for Zurich."
- class
- OBJECT_CREATION
- inherit
- ZURICH_OBJECTS
- feature -- Explore Zurich
- explore
- -- Create new objects for Zurich.
- do
- add_buildings
- add_route
- Zurich_map.update
- end
- -- Custom buildings as attributes
- eth_main: BUILDING
- opera_house: BUILDING
- spruengli: BUILDING
- add_buildings
- -- Add some buildings
- local
- -- Building vectors as locals
- NW_eth_main: VECTOR
- SE_eth_main: VECTOR
- NW_opera_house: VECTOR
- SE_opera_house: VECTOR
- NW_spruengli: VECTOR
- SE_spruengli: VECTOR
- do
- -- Creating the three buildings
- create NW_eth_main.make (230, -10)
- create SE_eth_main.make (300, -100)
- create eth_main.make ("eth_main", NW_eth_main, SE_eth_main)
- Zurich.add_building (eth_main)
- create NW_opera_house.make (250, -1420)
- create SE_opera_house.make (350, -1480)
- create opera_house.make ("opera_house", NW_opera_house, SE_opera_house)
- Zurich.add_building (opera_house)
- create NW_spruengli.make (-90, -660)
- create SE_spruengli.make (-60, -700)
- create spruengli.make ("spruengli", NW_spruengli, SE_spruengli)
- Zurich.add_building (spruengli)
- end
- polyterrasse_paradeplatz_opera: ROUTE -- Custom route as an attribute
- add_route
- -- Add a route (Polyterrasse - Paradeplatz - Opernhaus)
- local
- -- The legs as locals
- polyterrasse_central: LEG
- central_paradeplatz: LEG
- paradeplatz_opera: LEG
- do
- -- Creating the custom route
- create polyterrasse_central.make (Zurich.station ("Polyterrasse"), Zurich.station ("Central"), Zurich.line (24))
- create central_paradeplatz.make (Zurich.station ("Central"), Zurich.station ("Paradeplatz"), Zurich.line (6))
- create paradeplatz_opera.make (Zurich.station ("Paradeplatz"), Zurich.station ("Opernhaus"), Zurich.line (2))
- polyterrasse_central.link (central_paradeplatz)
- central_paradeplatz.link (paradeplatz_opera)
- create polyterrasse_paradeplatz_opera.make (polyterrasse_central)
- Zurich.add_route (polyterrasse_paradeplatz_opera)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement