Adds default methods for Commands (#238) (#238)

Closes #235
This commit is contained in:
Krypton Cougars
2016-11-18 17:42:40 -05:00
committed by Peter Johnson
parent b115c75226
commit b78f580d47
24 changed files with 214 additions and 203 deletions

View File

@@ -7,25 +7,13 @@
#include "Commands/PrintCommand.h"
#include <cstdio>
#include <sstream>
#include <iostream>
using namespace frc;
PrintCommand::PrintCommand(const std::string& message)
: Command(((std::stringstream&)(std::stringstream("Print \"") << message
<< "\""))
.str()
.c_str()) {
: InstantCommand("Print \"" + message + "\"") {
m_message = message;
}
void PrintCommand::Initialize() { std::printf("%s", m_message.c_str()); }
void PrintCommand::Execute() {}
bool PrintCommand::IsFinished() { return true; }
void PrintCommand::End() {}
void PrintCommand::Interrupted() {}
void PrintCommand::Initialize() { std::cout << m_message << "\n"; }