indexing description: "[ SCENE Objects represent game scenes containing items, areas and timers. This class is part of the XAE Extended Adventure Engine Project. ]" author: "Adrian Rabenseifner, radrian@student.ethz.ch" date: "$Date$" revision: "$Revision$" class SCENE create make, initialize feature {NONE} -- Initialization make is -- Initialize `Current'. do create items.make create areas.make create timers.make create description.make_empty create transition.make_empty end initialize(pname, pbackground_path: STRING) is -- initialize scene with default name (unique id) and path to bg image do make name := pname background_path := pbackground_path end feature -- Access name: STRING -- unique id description: STRING -- short description of scene (optional) background_path: STRING -- path to backround image (0 - 180°) background_path_2: STRING -- path to backround image (180° - 360°) - optional (default: void) items: LINKED_LIST[ITEM] -- items contained in scene areas: LINKED_LIST[AREA] -- clickable areas in scene timers: LINKED_LIST[TIMER] -- clickable areas in scene transition: STRING -- transition effect (optinal) angle: INTEGER add_item(item: ITEM) is -- add game item do items.extend(item) end add_area(area: AREA) is -- add clickable area do areas.extend(area) end add_timer(timer: TIMER) is -- add timer do timers.extend(timer) end set_name(pname: STRING) is -- set scene name (used in XML to identify a scene) do name := pname end set_description(pdescription: STRING) is -- set scene description text do description := pdescription end set_background_path(pbackground_path: STRING) is -- set scene background path do background_path := pbackground_path end set_background_path_2(pbackground_path: STRING) is -- set scene background path do background_path_2 := pbackground_path end feature -- {SHOW_SCENE} -- used while performin action set_transition(ptransition: STRING) is -- set type of transition used when loading the scene do transition := ptransition end set_angle(pangle: INTEGER) is -- set initial view angle for scene do angle := pangle end feature {ENGINE, GAME} -- Implementation set_visibility_flags(game: GAME) is -- remove all invisible items in the context of current game. local context: CONTEXT do create context.make(game.registry, game.repository, game.trash, void) from items.start until items.after loop -- item is not visible if the visibility conditions are violated -- or else if it is already in repository/trash items.item.set_visibility(context) items.forth end end end -- class SCENE