GUI
This module manages the project dungeon_gui
- class GUI.GUI(problem, result, rooms)
Bases:
objectThis class manages the project GUI
- run()
Run the GUI
- GUI.enter_room(player, screen, room, hud)
Updates room rendering when player enters the room
Parameters
- param player:
Player object
- type player:
Player
- param screen:
Screen where dungeon_gui runs
- type screen:
pygame Surface
- param room:
Room the player is entering
- type room:
Room
- param hud:
HUD object
- type hud:
HUD
- GUI.exit_room(player, screen, room, hud)
Updates room rendering when player leaves room
Parameters
- param player:
Player object
- type player:
Player
- param screen:
Screen where dungeon_gui runs
- type screen:
pygame Surface
- param room:
Room the player is exiting
- type room:
Room
- param hud:
HUD object
- type hud:
HUD
- GUI.fluent_to_int(state, fluent)
Converts unified_planning Fluent to int
Parameters
- param state:
Object representing the state of the problem
- type state:
unified_planning.shortcuts.State
- param fluent:
Object representing a fluent
- type fluent:
unified_planning.shortcuts.FluentExp
Returns
- returns:
The value of the fluent as an integer
- rtype:
int
- GUI.update_hud(hud, state, hero_loot, key_counter, potion_counter, actual_room_id, action, defeated_enemy_counter=None, is_exit=False)
Updates all hud variables
Parameters
- param hud:
HUD object
- type hud:
HUD
- param state:
Object representing the state of the problem
- type state:
unified_planning.shortcuts.State
- param hero_loot:
Object representing the hero loot fluent
- type hero_loot:
unified_planning.shortcuts.FluentExp
- param key_counter:
Object representing the key counter fluent
- type key_counter:
unified_planning.shortcuts.FluentExp
- param potion_counter:
Object representing the potion counter fluent
- type potion_counter:
unified_planning.shortcuts.FluentExp
- param actual_room_id:
The id of the actual room
- type actual_room_id:
int
- param action:
The last action executed
- type action:
str
- param defeated_enemy_counter:
Object representing the defeated enemy counter fluent
- type defeated_enemy_counter:
unified_planning.shortcuts.FluentExp
- param is_exit:
Flag to check if the actual room is the exit room
- type is_exit:
bool