Add project skeleton: CMake, Game and bots

This commit is contained in:
2026-04-15 13:14:18 +02:00
parent 4a38215e31
commit 22e8ea8d46
11 changed files with 560 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
#pragma once
#include "../include/BaseRobot.h"
#include <type_traits>
class World;
class DigDeepBot : public BaseRobot {
public:
DigDeepBot ( const int startX, const int startY );
int mine ( World& world ) override;
};
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include <memory>
#include "World.h"
#include "Robot.h"
class Game {
public:
Game ();
void run ();
private:
World world_;
std::unique_ptr< Robot > player_;
std::unique_ptr < Robot > computer_;
bool autoMode_ = false;
int lastThreshold_ = 0;
void setup ();
void play ( Robot& robot, bool isPlayer );
void checkRearrange ( Robot& robot );
void applyEffects ( Robot& robot, int effect );
bool isGameOver() const;
void printScores() const;
void printResult() const;
std::unique_ptr < Robot > createRobot ( int choice, int x, int y ) const;
};
+12
View File
@@ -0,0 +1,12 @@
#pragma once
#include "BaseRobot.h"
class World;
class RandomBot : public BaseRobot {
/* A robot that digs at a random depth */
public:
RandomBot ( const int startX, const int startY );
int mine ( World& world ) override;
};