indexing description: "[ ITEM objects represent game items. Visibility is conditional and depends on registry state, repository and trash of the GAME object. If an item is either in repository or trash, it is not visible in the scene anymore. This class is part of the XAE Extended Adventure Engine Project. ]" author: "Adrian Rabenseifner, radrian@student.ethz.ch" date: "$Date$" revision: "$Revision$" class ITEM inherit TRIGGER DIMENSIONED CONDITIONED CONDITION rename satisfied as in_repository end create make, init feature {NONE} -- Initialization make is -- Initialize `Current'. do init_condition_lists init_action_list create closeups.make end init(pname, pdefault_path: STRING; prepository_path: STRING) is -- initialize with data do make name := pname default_path := pdefault_path repository_path := prepository_path end feature -- Access name: STRING -- unique id description: STRING -- short description default_path: STRING repository_path: STRING closeups: LINKED_LIST[CLOSEUP] animation: ANIMATION is_visible: BOOLEAN -- flag used by gui set_name(pname: STRING) is -- set name do name := pname end set_description(pdescription: STRING) is -- set description text do description := pdescription end add_closeup(closeup: CLOSEUP) is -- set closeup do closeups.extend(closeup) end set_default_path(path: STRING) is -- set closeup do default_path := path end set_repository_path(path: STRING) is -- set closeup do repository_path := path end set_animation(panimation: ANIMATION) is -- set animation do animation := panimation end set_visibility(context: CONTEXT) is -- check visibility under the context of a given game do -- item is visible if -- > visibility conditions hold (from CONDITIONED) -- > item is not in repository -- > item is not in trash is_visible := check_conditions(context) and (not in_repository(context)) and (not in_trash(context)) end in_repository(context: CONTEXT): BOOLEAN is -- condition is satisfied under the context of a given game -- (from CONDITION.satisfied) do Result := context.repository.contains(Current) end feature {NONE} -- Implementation in_trash(context: CONTEXT): BOOLEAN is -- checks if item is in trash of current game (already used) do Result := context.trash.contains(Current) end end -- class ITEM