-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathViewer.cpp
111 lines (93 loc) · 1.98 KB
/
Viewer.cpp
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#pragma once
#include "Viewer.h"
#include "Viewer.h"
#include <iostream>
Viewer::Viewer()
{
this->header_message = "============= DOCO World Simulation =============";
this->footer_message = "Created by: Stephen Stammen\n";
this->separator_line = std::string(this->separator_length, this->separator_char);
this->program_state_message = "running";
}
Viewer::~Viewer()
{
}
void Viewer::setHeaderMessage(std::string newHeader)
{
if (newHeader.length() < 100) {
this->header_message = newHeader;
}
else
{
this->header_message = "Too Long Header Message Attempted";
}
}
void Viewer::setFooterMessage(std::string newFooter)
{
if (newFooter.length() < 100) {
this->footer_message = newFooter;
}
else
{
this->footer_message = "Too Long Footer Message Attempted";
}
}
void Viewer::setProgramStateMessage(std::string newState)
{
this->program_state_message = newState;
}
void Viewer::setLineCountWorld(int lineCount)
{
this->line_count_world = lineCount;
}
void Viewer::setSeparatorChar(char myChar)
{
this->separator_char = myChar;
}
void Viewer::setSeparatorLength(int newLength)
{
if (newLength < 100) // prevent more than 150 characters for separation
{
this->separator_length = newLength;
}
else
{
this->separator_length = 100;
}
}
void Viewer::setNewSeparatorLine(void)
{
this->separator_line = std::string(this->separator_length, this->separator_char);
}
std::string Viewer::getHeaderMessage(void)
{
return this->header_message;
}
std::string Viewer::getFooterMessage(void)
{
return this->footer_message;
}
std::string Viewer::getProgramStateMessage(void)
{
return this->program_state_message;
}
std::string Viewer::getNewSeparatorLine(void)
{
return this->separator_line;
}
void Viewer::printSeparator(void)
{
std::cout << this->separator_line << "\n";
}
int Viewer::getLineCountWorld(void)
{
return this->line_count_world;
}
int Viewer::getSeparatorLength(void)
{
return this->separator_length;
}
char Viewer::getSeparatorChar(void)
{
return this->separator_char;
}