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
Conversation
Nordsoft91
commented
May 19, 2022
- Fix issue with town entry blocked by monster
- Implemented extra resources nearby mines on random map
This comment was marked as resolved.
This comment was marked as resolved.
lib/rmg/CRmgTemplateZone.cpp
Outdated
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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