Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved MainSaveFile Singleton anti-pattern and added Turnip prices #24

Merged
merged 3 commits into from
Apr 13, 2020
Merged

Resolved MainSaveFile Singleton anti-pattern and added Turnip prices #24

merged 3 commits into from
Apr 13, 2020

Conversation

igromanru
Copy link
Contributor

Hi, I added Turnip prices to MyHorizons.
While I was working with the code I couldn't overlook the MainSaveFile.Singleton().
It isn't a real Singletone and it can be solved without it, I hope you don't mind my refactoring.

public int NumPlayers => _playerSaves.Count;
public readonly Town? Town;
public readonly Turnips? Turnips;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should be in the Town class as the idea is for it to encompass everything town related and turnip prices are per-town.

@Cuyler36
Copy link
Owner

Also I'm not a fan of the name "Turnips". Preferably the name should convey purpose. You aren't editing the turnips but rather the selling/buy price. I'd prefer something more like "StalkMarket".

moved StalkMarket Property to the Town class
@igromanru
Copy link
Contributor Author

Funny thing, I was also thinking about it, after I created the PR.
How do you like it now?

@Cuyler36 Cuyler36 merged commit 153b6f8 into Cuyler36:master Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants