MichaelAGolden / pymerchant

Merchant trader simulation written in Python
1 stars 0 forks source link

Refactor #18

Closed MichaelAGolden closed 4 months ago

MichaelAGolden commented 1 year ago

As I've learned more about python and better ways to approach problem, I realize that I need to change some of my approach. Therefore, I've set out to rebuild the the classes in one file for the time being and work with something that is more "object oriented" or data structured I suppose.

My critique before was that my classes and methods had poor cohesion and had a high degree of coupling. In this refactor I am looking to rethink the approach I originally took and focus designing the structure of the program at the start so that the project takes less time to complete.

MichaelAGolden commented 1 year ago

(current) Overall class structure - WIP

Parent Classes Inventory Item

City Rumors (Interact and get rumors) MarketInventory MarketItem

Player PlayerInventory PlayerItem

Travel (Distance calculations, updating traveltime days) Economy (pricing mechanisms)

Game (Loop, user inputs)

View (Visual representation)

  1. Game Starts - player selects from menu of options
  2. Player buys good at market
  3. Player moves to another city to sell at another market
  4. Player sells product and buys something else
  5. Player also can go to places inside city to hear rumors
  6. Player hears a rumor that there is a high demand for tools in malmo, so they buy tools in current city and head to Malmo.
  7. Sell tools in Malmo and listen for a new rumor if any
  8. Player travel is
MichaelAGolden commented 4 months ago

Closing as restarting this project a new approach will be taken