Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/llaniewski-bot/SuperBot.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "SuperBot.h"
#include <math.h>

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 >;
15 changes: 15 additions & 0 deletions src/llaniewski-bot/SuperBot.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once
#include "../Player.h"
#include <string>

namespace llaniewski_bot {

class SuperBot : public Player {
public:
static std::string id;
SuperBot();
virtual void Play(double, TankControl *);
virtual ~SuperBot();
};

}