Skip to content

Commit

Permalink
change lock code, parties to use
Browse files Browse the repository at this point in the history
  • Loading branch information
selym3 committed Jun 27, 2022
1 parent 9810aeb commit a48a0d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions algos/map_behavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,19 @@ void MapBehavior::handle_event(engine& e, const sf::Event& event)
// TODO: this is duumb, make better swapping code
else if (event.key.code == sf::Keyboard::O)
{
bool was_paused = paused;
paused = true;
while (evolving);
map.set_metric(std::make_unique<PopulationMetric>());
paused = false;
map.set_metric(std::make_unique<PartyPopulationMetric>());
if (!was_paused) paused = false;
}
else if (event.key.code == sf::Keyboard::P)
{
bool was_paused = paused;
paused = true;
while (evolving);
map.set_metric(std::make_unique<CenteringMetric>());
paused = false;
if (!was_paused) paused = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gm::Map get_map()
{
return gm::Map
(
std::make_unique<gm::PopulationMetric>(),
std::make_unique<gm::PartyPopulationMetric>(),
gm::Map::Settings{ 12, 0.1 },
gm::Map::Grid{200, 200}
);
Expand Down

0 comments on commit a48a0d4

Please sign in to comment.