Correct field's initialization
This commit is contained in:
21
include/Player.h
Normal file
21
include/Player.h
Normal 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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user