rework string functions and get easyly player data

This commit is contained in:
2024-04-04 12:16:17 +02:00
parent 7972b5ceea
commit 6442e1c8e4
3 changed files with 29 additions and 2 deletions
+15
View File
@@ -17,6 +17,7 @@ class GameBoard:
def print_story(self, story:str):
print(story)
# Save State
def find_game_state(self):
if os.path.exists(self.save_state_file['path']):
self.saved_state = SavedState.load_from_file(self.save_state_file)
@@ -32,6 +33,20 @@ class GameBoard:
def save_game_state(self):
self.saved_state.save_to_file(self.save_state_file)
def get_game_state(self):
return self.saved_state
#Player
def get_player(self):
return self.saved_state.get_player()
def get_player_species(self):
return self.saved_state.get_player_species(self.config["player"]["species"])
def get_player_combineble_species(self):
return self.saved_state.get_player_combineble(self.config["player"]["species"])
# Functions
def replace_keyword_into_place_story(self, place:dict):
story:str = place['story']
story.replace("SPECIES", self.saved_state.get_player().get_species_name())