Skip to content

Manager

progature.engine.core.game.manager

GameManager

GameManager(game_path)

GameManager is the main interface between GUI and Python objects. This class works as an API for GUI. GameManger uses GameHandler and GameLoader to work with JSON files.

Attributes:

Name Type Description
game Game

Game object that we want to manage.

_handler GameHandler

GameHandler object that will handler the JSON part of the Game.

Game manager that manage games inside app, This class is an interface between user and games.

Parameters:

Name Type Description Default
game_path str

Path of the game we want to work with.

required
game instance-attribute
game = load(game_path)
current_chapter_index instance-attribute
current_chapter_index = 0
game_name
game_name()

Returns the name property of Game object.

Returns:

Type Description
str

name of the game

game_skill
game_skill()

Returns the skill property of Game object.

Returns:

Type Description
Skill or None

skill of the game

game_complete
game_complete()

Wrtie True on is_complete. This method will make the game completed

chapter_complete
chapter_complete(chapter_index)

Write True on is_complete for Chapter, This method will run handler.chapter_complete().

Parameters:

Name Type Description Default
chapter_index int

Index of the chapter you want to complete.

required
level_complete
level_complete(chapter_index, level_index)

Write True on is_complete for Level, This method will run handler.level_complete().

Parameters:

Name Type Description Default
chapter_index int

Index of the level's chapter you want to complete.

required
level_index int

Index of the level you want to complete.

required
quest_complete
quest_complete(chapter_index, level_index, quest_index)

Write True on is_complete for Quest, This method will run handler.quest_complete().

Parameters:

Name Type Description Default
chapter_index int

Index of the quest's level's chapter you want to complete.

required
level_index int

Index of the quest's level you want to complete.

required
quest_index int

Index of the quest you want to complete.

required
chapters
chapters()

Returns the chapters property of Game object.

Returns:

Type Description
Pot[Chapter] or None

chapters of the game.

current_chapter
current_chapter()
next_cahpter
next_cahpter()
nth_chapter
nth_chapter(index)
get_chapter_levels
get_chapter_levels(chapter_index)
get_level_quests
get_level_quests(chapter_index, level_index)