Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __MoveCommand_h__
- #define __MoveCommand_h__
- #include "GameCommand.h"
- #include "game.h"
- //#include "Item.h"
- #include "Room.h"
- #include <iostream>
- #include <cassert>
- ////////////////////////////////////////////////////////////////////////////////
- class MoveCommand : public GameCommand
- {
- // direction
- int dir;
- public:
- MoveCommand(int _dir)
- {
- dir = _dir;
- }
- virtual ~MoveCommand() {}
- void Execute() // implementation for pure virtual function in ICommand.
- {
- Room *room;
- room = GetGame()->GetCurrentRoom()->GetNextRoom(dir);
- if (room != NULL) {
- //cout << "You found " + item->GetName() + ".\n";
- cout << "You move to the next room";
- }
- else {
- cout << "You found nothing.\n";
- }
- }
- };
- ////////////////////////////////////////////////////////////////////////////////
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement