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

21
include/Player.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include <string>
#include <vector>
#include "stdafx.h"
class Player {
private:
char name;
std::vector<std::unique_ptr<Soldier>> army;
double score;
public:
Player() {
score = 0.;
for (auto i = 0; i < 4; ++i) {
army.push_back(std::make_unique<Infantry>());
}
}
std::vector<std::unique_ptr<Soldier>>& get_army() {
return army;
}
};