Add project skeleton: CMake, Game and bots
This commit is contained in:
@@ -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;
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user