indexing description: "Testbench" author: "Adrian Rabenseifner" date: "2005/05/12" revision: "0.1" class TESTBENCH create make feature {NONE} -- Initialization make is -- Initialize `Current'. do api_sample end api_sample is -- sample feature that creates a simple GAME local game: GAME scene1: SCENE scene2: SCENE event: EVENT area1, area2, area3: AREA item1, item2, item3: ITEM show_scene: SHOW_SCENE change_setting: CHANGE_SETTING pickup: PICKUP remove: REMOVE condition: SETTING setting, setting1, setting2, setting3: SETTING do create game.make -- create first scene create scene1.make game.add_scene(scene1) -- create 2nd scene create scene2.make game.add_scene(scene2) -- registry create setting1.make("test", false) create setting2.make("test", true) create setting3.make("test", false) --game.registry.set(setting1) --game.registry.set(setting2) -- debug output io.put_string("test auf nicht vorhandene false Setting: ") io.put_boolean(game.registry.contains(setting1)) io.put_new_line io.put_string("test auf nicht vorhandene true Setting: ") io.put_boolean(game.registry.contains(setting2)) io.put_new_line -- fill scene and add actions (scene1) create area1.make create show_scene.make(scene2) area1.add_action(show_scene) scene1.add_area(area1) -- fill scene and add actions (scene2) create area2.make create area3.make create show_scene.make(scene1) create condition.make("test", false) -- add nessesary condition (notwendig) -- simple KNF show_scene.knf.add_condition(condition) area1.add_action(show_scene) create condition.make("test", true) -- add sufficient condition (hinreichend) -- simple DNF show_scene.dnf.add_condition(condition) area2.add_action(show_scene) create setting.make("abc", true) create change_setting.make(setting) area3.add_action(change_setting) create item1.make create item2.make item1.set_name("test item") create pickup.make(item1) item1.add_action(pickup) -- add areas to scene2 scene2.add_area(area2) scene2.add_area(area3) scene2.add_item(item1) create engine.make engine.set_game(game) game.registry.debug_output game.repository.debug_output create event.make(area3, void) engine.event_occured(event) create event.make(item1, void) engine.event_occured(event) game.registry.debug_output game.repository.debug_output -- pause io.read_integer end feature -- Access feature {NONE} -- Implementation engine: ENGINE action1: SHOW_SCENE action2: SHOW_CLOSEUP action3: PICKUP action4: CHANGE_SETTING end -- class TESTBENCH