-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.cpp
More file actions
37 lines (32 loc) · 1.12 KB
/
Copy pathcommand.cpp
File metadata and controls
37 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Parent class to child command classes
// Handles the commands from the file. Manages subclasses using input command
// characters. Builds command objects from data file and calls execute.
//
// Assumptions:
// -- Data file format is correct
//
// Implementation:
// -- Has access to Library class through a reference to a pointer
// -- Builds and checks command type and values
//
//---------------------------------------------------------------------------
#include "command.h"
#include "patron.h"
//---------------------------------------------------------------------------
// constructor
Command::Command() {
commType_ = ' ';
patron_ = 0;
item_ = nullptr;
patron_ = nullptr;
libraryPtr_ = nullptr;
}
//---------------------------------------------------------------------------
// destructor
Command::~Command() { item_ = nullptr; }
//---------------------------------------------------------------------------
// getItem
Item *Command::getItem() { return item_; }
//---------------------------------------------------------------------------
// getCommandType
char Command::getCommandType() { return commType_; }