Load Excel Module

The Load Excel module is responsible for extracting game data from Excel spreadsheets (.xlsx), validating it, and transforming it into Python data structures (primarily dictionaries) that can be used by the Property Tycoon game. This module serves as a bridge between external data files (like board layout and card text) and the game’s internal representation.

This module provides functions to:

  • Load detailed property information for each board space from PropertyTycoonBoardData.xlsx, including name, position, type (property, station, utility, tax, special), price, rent, house costs, group, and actions.

  • Handle potential variations in file paths and data formatting within the Excel file.

  • Load key-value pairs for game text (e.g., Chance/Pot Luck card descriptions) from the Game Text sheet in PropertyTycoonCardData.xlsx.

class src.Sound_Manager.SoundManager[source]

Bases: object

get_missing_files()[source]
load_music(music_file='background_music.mp3')[source]
load_settings()[source]
load_sounds()[source]
pause_music()[source]
play_music(loop=-1)[source]
play_sound(sound_name)[source]
save_settings()[source]
set_music_volume(volume)[source]
set_sound_volume(volume)[source]
stop_music()[source]
unpause_music()[source]

Detailed Design

Component Diagram

This diagram shows how the Load Excel module interacts with external Excel files and provides data to other game components.

Details the steps involved in reading the property data Excel file.

Shows the simpler process of reading the card/game text sheet.

Illustrates the structure of the dictionary returned by load_property_data. The keys are string representations of the board position numbers.

@startuml
skinparam object {
  BackgroundColor white
  BorderColor black
  ArrowColor black
}

object "properties_data" as PropertiesDict {
  "1" : GO space
  "2" : Old Kent Road
  "6" : Station
  "13" : Utility
  "39" : Tax space
  ... (more positions)
}

object "GO space" as Prop1 {
  name = "Go"
  position = 1
  type = "special"
  action = "Collect £200"
  can_be_bought = False
}

object "Old Kent Road" as Prop2 {
  name = "Old Kent Road"
  position = 2
  type = "property"
  group = "Brown"
  price = 60
  rent = 2
  house_costs = (10,30,90,160,250)
}

object "Station" as Prop6 {
  name = "King's Cross Station"
  position = 6
  type = "station"
  price = 200
  rent = 25
  is_station = True
}

object "Utility" as Prop13 {
  name = "Tesla Power Co"
  position = 13
  type = "utility"
  price = 150
  is_utility = True
}

object "Tax space" as Prop39 {
  name = "Super Tax"
  position = 39
  type = "tax"
  amount = 100
}

PropertiesDict --> Prop1
PropertiesDict --> Prop2
PropertiesDict --> Prop6
PropertiesDict --> Prop13
PropertiesDict --> Prop39
@enduml

Data Structure Diagram (Property Data)