From 28404d196253eff5ab9689c7a56ad351ef558202 Mon Sep 17 00:00:00 2001 From: Lukasz Laniewski-Wollk Date: Mon, 8 Oct 2018 20:32:27 +0200 Subject: [PATCH] Adding llaniewski_bot Bot --- src/llaniewski-bot/SuperBot.cpp | 29 +++++++++++++++++++++++++++++ src/llaniewski-bot/SuperBot.h | 15 +++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/llaniewski-bot/SuperBot.cpp create mode 100644 src/llaniewski-bot/SuperBot.h diff --git a/src/llaniewski-bot/SuperBot.cpp b/src/llaniewski-bot/SuperBot.cpp new file mode 100644 index 0000000..7d7b140 --- /dev/null +++ b/src/llaniewski-bot/SuperBot.cpp @@ -0,0 +1,29 @@ +#include "SuperBot.h" +#include + +namespace llaniewski_bot { + +std::string SuperBot::id = "llaniewski"; + +SuperBot::SuperBot(void) +{ + +} + +void SuperBot::Play(double time, TankControl* control) { + double left, right, turn=0, lift=0; + left = 25*sin(time); + right = 25; + control->ShootCannon(); + control->ShootGun(); + control->SetEngines(left, right, turn, lift); +} + +SuperBot::~SuperBot(void) +{ + +} + +} // end of namespace + +template class PlayerFactory::Register < llaniewski_bot::SuperBot >; diff --git a/src/llaniewski-bot/SuperBot.h b/src/llaniewski-bot/SuperBot.h new file mode 100644 index 0000000..788cadf --- /dev/null +++ b/src/llaniewski-bot/SuperBot.h @@ -0,0 +1,15 @@ +#pragma once +#include "../Player.h" +#include + +namespace llaniewski_bot { + +class SuperBot : public Player { +public: + static std::string id; + SuperBot(); + virtual void Play(double, TankControl *); + virtual ~SuperBot(); +}; + +} \ No newline at end of file