Initial commit
This commit is contained in:
commit
4f4397b3e1
48 changed files with 2002 additions and 0 deletions
26
NimGame/game/player/AbstractPlayer.h
Normal file
26
NimGame/game/player/AbstractPlayer.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// Created by JoachimWagner on 11.03.2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "Player.h"
|
||||
namespace atlas::game::player {
|
||||
|
||||
template<class BOARD, class TURN>
|
||||
class AbstractPlayer: public Player<BOARD, TURN>{
|
||||
|
||||
public:
|
||||
explicit AbstractPlayer(const std::string &name) : name(name) {}
|
||||
|
||||
const std::string getName() const override{
|
||||
return name;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
19
NimGame/game/player/Player.h
Normal file
19
NimGame/game/player/Player.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// Created by JoachimWagner on 11.03.2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace atlas::game::player {
|
||||
|
||||
template<class BOARD, class TURN>
|
||||
class Player {
|
||||
public:
|
||||
virtual ~Player() = default;
|
||||
virtual auto getName() const -> const std::string = 0;
|
||||
virtual auto doTurn(const BOARD &board) const -> TURN = 0;
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue