Correct field's initialization

This commit is contained in:
2025-07-07 02:33:19 +03:00
parent d4d3ade78b
commit f13bf95ba2
11 changed files with 265 additions and 14 deletions

14
include/Soldier.h Normal file
View File

@@ -0,0 +1,14 @@
#pragma once
class Soldier {
private:
double HP;
double attack;
double defence;
char type;
protected:
Soldier() : HP(100), attack(1), defence(1) {};
Soldier(double _HP, double _attack, double _defence) : HP(_HP), attack(_attack), defence(_defence) {};
public:
virtual int step() = 0;
virtual void fire() = 0;
};