Permalink
Browse files

Implemented ActorCommand descendents.

  • Loading branch information...
1 parent 6de982b commit 3c86cd0b8e036ea14cc32fcdea80fff400d55c1a @cjfrisz committed Sep 16, 2011
Showing with 300 additions and 0 deletions.
  1. +36 −0 JumpCommand.cpp
  2. +24 −0 JumpCommand.h
  3. +36 −0 MoveDownCommand.cpp
  4. +24 −0 MoveDownCommand.h
  5. +36 −0 MoveLeftCommand.cpp
  6. +24 −0 MoveLeftCommand.h
  7. +36 −0 MoveRightCommand.cpp
  8. +24 −0 MoveRightCommand.h
  9. +36 −0 MoveUpCommand.cpp
  10. +24 −0 MoveUpCommand.h
View
36 JumpCommand.cpp
@@ -0,0 +1,36 @@
+#include "ActorCommand.h"
+#include "JumpCommand.h"
+
+namespace evolver {
+
+ JumpCommand::JumpCommand () {
+ // Nothing to do yet
+ }
+
+ JumpCommand::~JumpCommand () {
+ // Nothing to do yet
+ }
+
+ JumpCommand::JumpCommand (const JumpCommand &original) {
+ this->copyJumpCommand(original);
+ }
+
+ JumpCommand &JumpCommand::operator= (const JumpCommand &rhs) {
+ if (this != &rhs) {
+ this->copyJumpCommand(rhs);
+ }
+
+ return *this;
+ }
+
+ void JumpCommand::execute () {
+ this->getActor()->getMoveBehavior()->jump();
+ }
+
+ void JumpCommand::copyJumpCommand (const JumpCommand &original) {
+ this->copyActorCommand();
+
+ return;
+ }
+
+}
View
24 JumpCommand.h
@@ -0,0 +1,24 @@
+#ifndef __JUMPCOMMAND_H__
+#define __JUMPCOMMAND_H__
+
+#include "ActorCommand.h"
+
+namespace evolver {
+
+ class JumpCommand : public ActorCommand {
+ public:
+ JumpCommand (void);
+ ~JumpCommand (void);
+ JumpCommand (const JumpCommand &original);
+
+ JumpCommand &operator= (const JumpCommand &rhs);
+
+ void execute (void);
+
+ protected:
+ void copyJumpCommand (const JumpCommand &original);
+ };
+
+}
+
+#endif
View
36 MoveDownCommand.cpp
@@ -0,0 +1,36 @@
+#include "ActorCommand.h"
+#include "MoveDownCommand.h"
+
+namespace evolver {
+
+ MoveDownCommand::MoveDownCommand () {
+ // Nothing to do yet
+ }
+
+ MoveDownCommand::~MoveDownCommand () {
+ // Nothing to do yet
+ }
+
+ MoveDownCommand::MoveDownCommand (const MoveDownCommand &original) {
+ this->copyMoveDownCommand(original);
+ }
+
+ MoveDownCommand &MoveDownCommand::operator= (const MoveDownCommand &rhs) {
+ if (this != &rhs) {
+ this->copyMoveDownCommand(rhs);
+ }
+
+ return *this;
+ }
+
+ void MoveDownCommand::execute () {
+ this->getActor()->getMoveBehavior()->moveDown();
+ }
+
+ void MoveDownCommand::copyMoveDownCommand (const MoveDownCommand &original) {
+ this->copyActorCommand();
+
+ return;
+ }
+
+}
View
24 MoveDownCommand.h
@@ -0,0 +1,24 @@
+#ifndef __MOVEDOWNCOMMAND_H__
+#define __MOVEDOWNCOMMAND_H__
+
+#include "ActorCommand.h"
+
+namespace evolver {
+
+ class MoveDownCommand : public ActorCommand {
+ public:
+ MoveDownCommand (void);
+ ~MoveDownCommand (void);
+ MoveDownCommand (const MoveDownCommand &original);
+
+ MoveDownCommand &operator= (const MoveDownCommand &rhs);
+
+ void execute (void);
+
+ protected:
+ void copyMoveDownCommand (const MoveDownCommand &original);
+ };
+
+}
+
+#endif
View
36 MoveLeftCommand.cpp
@@ -0,0 +1,36 @@
+#include "ActorCommand.h"
+#include "MoveLeftCommand.h"
+
+namespace evolver {
+
+ MoveLeftCommand::MoveLeftCommand () {
+ // Nothing to do yet
+ }
+
+ MoveLeftCommand::~MoveLeftCommand () {
+ // Nothing to do yet
+ }
+
+ MoveLeftCommand::MoveLeftCommand (const MoveLeftCommand &original) {
+ this->copyMoveLeftCommand(original);
+ }
+
+ MoveLeftCommand &MoveLeftCommand::operator= (const MoveLeftCommand &rhs) {
+ if (this != &rhs) {
+ this->copyMoveLeftCommand(rhs);
+ }
+
+ return *this;
+ }
+
+ void MoveLeftCommand::execute () {
+ this->getActor()->getMoveBehavior()->moveLeft();
+ }
+
+ void MoveLeftCommand::copyMoveLeftCommand (const MoveLeftCommand &original) {
+ this->copyActorCommand();
+
+ return;
+ }
+
+}
View
24 MoveLeftCommand.h
@@ -0,0 +1,24 @@
+#ifndef __MOVELEFTCOMMAND_H__
+#define __MOVELEFTCOMMAND_H__
+
+#include "ActorCommand.h"
+
+namespace evolver {
+
+ class MoveLeftCommand : public ActorCommand {
+ public:
+ MoveLeftCommand (void);
+ ~MoveLeftCommand (void);
+ MoveLeftCommand (const MoveLeftCommand &original);
+
+ MoveLeftCommand &operator= (const MoveLeftCommand &rhs);
+
+ void execute (void);
+
+ protected:
+ void copyMoveLeftCommand (const MoveLeftCommand &original);
+ };
+
+}
+
+#endif
View
36 MoveRightCommand.cpp
@@ -0,0 +1,36 @@
+#include "ActorCommand.h"
+#include "MoveRightCommand.h"
+
+namespace evolver {
+
+ MoveRightCommand::MoveRightCommand () {
+ // Nothing to do yet
+ }
+
+ MoveRightCommand::~MoveRightCommand () {
+ // Nothing to do yet
+ }
+
+ MoveRightCommand::MoveRightCommand (const MoveRightCommand &original) {
+ this->copyMoveRightCommand(original);
+ }
+
+ MoveRightCommand &MoveRightCommand::operator= (const MoveRightCommand &rhs) {
+ if (this != &rhs) {
+ this->copyMoveRightCommand(rhs);
+ }
+
+ return *this;
+ }
+
+ void MoveRightCommand::execute () {
+ this->getActor()->getMoveBehavior()->moveRight();
+ }
+
+ void MoveRightCommand::copyMoveRightCommand (const MoveRightCommand &original) {
+ this->copyActorCommand();
+
+ return;
+ }
+
+}
View
24 MoveRightCommand.h
@@ -0,0 +1,24 @@
+#ifndef __MOVERIGHTCOMMAND_H__
+#define __MOVERIGHTCOMMAND_H__
+
+#include "ActorCommand.h"
+
+namespace evolver {
+
+ class MoveRightCommand : public ActorCommand {
+ public:
+ MoveRightCommand (void);
+ ~MoveRightCommand (void);
+ MoveRightCommand (const MoveRightCommand &original);
+
+ MoveRightCommand &operator= (const MoveRightCommand &rhs);
+
+ void execute (void);
+
+ protected:
+ void copyMoveRightCommand (const MoveRightCommand &original);
+ };
+
+}
+
+#endif
View
36 MoveUpCommand.cpp
@@ -0,0 +1,36 @@
+#include "ActorCommand.h"
+#include "MoveUpCommand.h"
+
+namespace evolver {
+
+ MoveUpCommand::MoveUpCommand () {
+ // Nothing to do yet
+ }
+
+ MoveUpCommand::~MoveUpCommand () {
+ // Nothing to do yet
+ }
+
+ MoveUpCommand::MoveUpCommand (const MoveUpCommand &original) {
+ this->copyMoveUpCommand(original);
+ }
+
+ MoveUpCommand &MoveUpCommand::operator= (const MoveUpCommand &rhs) {
+ if (this != &rhs) {
+ this->copyMoveUpCommand(rhs);
+ }
+
+ return *this;
+ }
+
+ void MoveUpCommand::execute () {
+ this->getActor()->getMoveBehavior()->moveUp();
+ }
+
+ void MoveUpCommand::copyMoveUpCommand (const MoveUpCommand &original) {
+ this->copyActorCommand();
+
+ return;
+ }
+
+}
View
24 MoveUpCommand.h
@@ -0,0 +1,24 @@
+#ifndef __MOVEUPCOMMAND_H__
+#define __MOVEUPCOMMAND_H__
+
+#include "ActorCommand.h"
+
+namespace evolver {
+
+ class MoveUpCommand : public ActorCommand {
+ public:
+ MoveUpCommand (void);
+ ~MoveUpCommand (void);
+ MoveUpCommand (const MoveUpCommand &original);
+
+ MoveUpCommand &operator= (const MoveUpCommand &rhs);
+
+ void execute (void);
+
+ protected:
+ void copyMoveUpCommand (const MoveUpCommand &original);
+ };
+
+}
+
+#endif

0 comments on commit 3c86cd0

Please sign in to comment.