indexing description: "[ GAME Objects represent a game. They contain also a registry and twe repositories to maintain the game state. All picked items are in repository, all removed items are in trash. This class is part of the XAE Extended Adventure Engine Project. ]" author: "Adrian Rabenseifner, radrian@student.ethz.ch" date: "$Date$" revision: "$Revision$" class GAME inherit STORABLE create make feature {NONE} -- Initialization make is -- Initialize `Current'. do -- create list of scenes create scenes.make -- create registry and repository, default registry size: 1024 create registry.make(1024) -- repository: max 5 items create repository.make(6) -- trash: no limit => 0 create trash.make(0) -- start message (empty) message := "" end feature -- Access current_scene: SCENE current_closeup: CLOSEUP scenes: LINKED_LIST[SCENE] repository: REPOSITORY -- contains items in repositroy trash: REPOSITORY -- contains all used items registry: REGISTRY -- contains all game settings scene_changed: BOOLEAN items_picked_up: BOOLEAN message: STRING reset_flags is -- reset flags do scene_changed := false items_picked_up := false end add_scene(scene: SCENE) is -- Type your comment here do scenes.extend(scene) end -- used by parser set_start_scene(pscene: SCENE) is -- change current scene do current_scene := pscene scene_changed := true end -- only used by engine set_current_scene(pscene: SCENE) is -- change current scene do if current_scene /= pscene then current_scene := pscene scene_changed := true -- after change of scene, hide closeup current_closeup := void end end -- only used by engine set_current_closeup(pcloseup: CLOSEUP) is -- change current closeup do current_closeup := pcloseup end has_scene_changed: BOOLEAN is -- check if scene has changed since last call of "has scene changed" do Result := scene_changed end have_items_been_picked_up: BOOLEAN is -- check if items have been picked up since last call of "have items been picked up" do Result := items_picked_up end -- only used by engine scene_has_changed is -- force repaint of scene by next opportunity do scene_changed := true -- update visibility of all items (in regard to repository (or trash) and registry current_scene.set_visibility_flags(Current) end -- only used by engine items_have_been_changed is -- force repaint of items in scene by next opportunity do items_picked_up := true -- update visibility of all items (in regard to repository (or trash) and registry current_scene.set_visibility_flags(Current) end set_message(msg: STRING) is -- set message do message := msg end invariant message /= void end -- class GAME