Moved the game engine into its own unit and then made a failing test for it.

This commit is contained in:
Zed A. Shaw 2024-08-09 23:01:06 -04:00
parent fb5bf9d733
commit 440be444ea
7 changed files with 82 additions and 49 deletions

22
game_engine.hpp Normal file
View file

@ -0,0 +1,22 @@
#include <string>
#include <map>
using namespace std;
class GameEngine {
int hit_points = 0;
map<string, int> damage_types{
{"error", 4},
{"warning", 1},
{"note", 1},
};
public:
GameEngine(int hp);
int determine_damage(string &type);
bool hit(string &type);
bool is_dead();
};