-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessageSystem.cpp
More file actions
27 lines (23 loc) · 870 Bytes
/
MessageSystem.cpp
File metadata and controls
27 lines (23 loc) · 870 Bytes
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
//MessageSystem.cpp -- implementation file for MessageSystem class
//written 2016/05/16
//Good Day Fishing
//a game written by Jean Park
//created April 2016
#include <iostream>
#include <iomanip>
#include "MessageSystem.hpp"
#include "Player.hpp" //only needed for Player Constant
using namespace std;
using namespace MessageSystemConstant;
void MessageSystem::displayHealthMeter(int health, int score, const std::string &fish_name) {
cout << "GOOD DAY: [";
char bar = METER_CHAR;
for (int i = 0; i < health; i++) {
cout << bar--;
}
for (int i = health; i < PlayerConstant::FULL_HEALTH; i++) {
cout << ' ';
}
cout << "]\t\t\t" << left << setw(WorldConstant::FRAME_WIDTH - GOOD_DAY_METER_DISPLAY_WIDTH - SCORE_DISPLAY_WIDTH) << fish_name;
cout << "score:" << setw(SCORE_SPACE) << right << score << endl;
}