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

Add GoldMine implementation #64

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Add GoldMine implementation #64

wants to merge 11 commits into from

Conversation

hrishikeshshekhar
Copy link
Contributor

Addresses the issue of splitting gold in case a mine has a limited amount of gold to deliver

src/state/include/state/gold_manager/gold_manager.h Outdated Show resolved Hide resolved
src/state/include/state/gold_manager/gold_mine.h Outdated Show resolved Hide resolved
// Build the factory
factory->IncrementConstructionCompletion(
factory->GetTotalConstructionCompletion());

// Expecting gold manager calls when factory transitions from UNBUILD state
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Expecting gold manager calls when factory transitions from UNBUILD state
// Expecting gold manager calls when factory transitions from UNBUILT state

test/state/gold_manager_test.cpp Outdated Show resolved Hide resolved
- Add an interface for GoldManager.
- Add forward declarations Actor and GoldManager to fix circular dependecy.
- Add GoldMines for easy accessing GoldMines
- Add helper functions in GoldManager and a hash map to map GoldMine to number of requests
- Add logic to create request for mining gold from a mine
- Change GoldManager constructors in logger_test.cpp, soldier_test.cpp, factory_test.cpp, villager_test.cpp, state_test.cpp
- Remove segmentation faults in villager tests caused due to inavailability of gold mines
- Changing gold mines in gold manager to unique pointers and changing the mine requests to type pointers for keys
- Removing GoldManager dependency in all tests and adding GoldManagerMock
- Add GoldManager expectations for villager_test.cpp
- Add GoldManager expectations for soldier_test.cpp
- Add GoldManager expectations for logger_test.cpp
- Add GoldManager expectations for factory_test.cpp
- Add GoldManager expectations for state_test.cpp
- Add test for checking if MineRequests are added
- Add test to check if gold is split in the right ratio when multiple villagers are mining the same GoldMine
- Remove getter and setter functions in GoldMine
- Add gold manager mock in soldier tests
- Fix merge conflicts in state_test.cpp, logger_test.cpp
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.

3 participants