engine/calculators/source/unit_tests/DepthBasedDangerLevelCalculator_test.cpp
// This case covers the endgame floating tower
This case covers the endgame floating tower
This case covers the endgame floating tower
TEST(SW_Engine_Calculators_DepthBasedDangerLevelCalculator, calculate_danger_level_overworld)
{
  Depth depth(-10, -20, 0, 7, true);
  Depth depth2(-17, -20, 0, 7, true);
  Dimensions dim;
  dim.set_depth(depth);
  MapPtr map = std::make_shared<Map>(dim);
  dim.set_depth(depth2);
  MapPtr map2 = std::make_shared<Map>(dim);
  map->set_danger(3);
  DepthBasedDangerLevelCalculator calc(ExitMovementType::EXIT_MOVEMENT_ASCEND);
  int calculated = calc.calculate(map, map2);
  EXPECT_EQ(10, calculated);
  map2->set_danger(10);
  DepthBasedDangerLevelCalculator calc2(ExitMovementType::EXIT_MOVEMENT_DESCEND);
  calculated = calc2.calculate(map2, map);
  EXPECT_EQ(3, calculated);
}
TEST ( SW_Engine_Calculators_DepthBasedDangerLevelCalculator , calculate_danger_level_overworld ) { Depth depth ( -10 , -20 , 0 , 7 , true ) ; Depth depth2 ( -17 , -20 , 0 , 7 , true ) ; Dimensions dim ; dim . set_depth ( depth ) ; MapPtr map = std :: make_shared < Map > ( dim ) ; dim . set_depth ( depth2 ) ; MapPtr map2 = std :: make_shared < Map > ( dim ) ; map -> set_danger ( 3 ) ; DepthBasedDangerLevelCalculator calc ( ExitMovementType :: EXIT_MOVEMENT_ASCEND ) ; int calculated = calc . calculate ( map , map2 ) ; EXPECT_EQ ( 10 , calculated ) ; map2 -> set_danger ( 10 ) ; DepthBasedDangerLevelCalculator calc2 ( ExitMovementType :: EXIT_MOVEMENT_DESCEND ) ; calculated = calc2 . calculate ( map2 , map ) ; EXPECT_EQ ( 3 , calculated ) ; }
This case covers the endgame floating tower
This case covers the endgame floating tower
// Back down the tower...