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

[0002285] Implement feature with extra resources near mines #742

Merged
merged 7 commits into from May 23, 2022

Conversation

Nordsoft91
Copy link
Member

  1. Fix issue with town entry blocked by monster
  2. Implemented extra resources nearby mines on random map

Снимок экрана 2022-05-19 в 06 20 35

Снимок экрана 2022-05-19 в 06 19 05

@Nordsoft91

This comment was marked as resolved.

@Nordsoft91 Nordsoft91 changed the title Rmg revise [0002285] Implement feature with extra resources near mines May 20, 2022
Comment on lines 1313 to 1317
auto mine = (CGMine*) VLC->objtypeh->getHandlerFor(Obj::MINE, res)->create(ObjectTemplate());
tempmines.emplace_back(mine);
mine->producedResource = res;
mine->tempOwner = PlayerColor::NEUTRAL;
mine->producedQuantity = mine->defaultResProduction();
Copy link
Member

Choose a reason for hiding this comment

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

This section of code is repeated a few times. I suggest to introduce a factory method to create a mine by res type and set these default settings and afterwards we will only need to call addRequiredObject/addCloseObject

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for advise! I decided to change a bit this code but keep the idea to remove duplications

@nullkiller nullkiller merged commit a8265c7 into vcmi:develop May 23, 2022
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.

None yet

3 participants