-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.cpp
More file actions
executable file
·58 lines (48 loc) · 1.18 KB
/
game.cpp
File metadata and controls
executable file
·58 lines (48 loc) · 1.18 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <QTextStream>
#include <QFile>
#include "game.h"
#include "team.h"
game::game(team* home, team* away, int day)
: _home(home)
, _away(away)
, _day(day)
{
validate();
}
game::~game(void)
{
}
void game::swap()
{
team* temp = _home;
_home = _away;
_away = temp;
}
void game::print(QFile &file)
{
QTextStream out(&file);
if (_home->team_id()==""){
out << _home->name();
}else{
out << "[url=" << _home->team_url() << "]" << _home->name() <<"[/url]";
}
out << " (" << _home->raceName() << ") : ";
if (_home->coach_id()==""){
out << _home->coach();
}else{
out << "[url=" << _home->coach_url() << "]" << _home->coach() <<"[/url]";
}
out << " [b]vs[/b] ";
if (_away->team_id()==""){
out << _away->name();
}else{
out << "[url=" << _away->team_url() << "]" << _away->name() <<"[/url]";
}
out << " (" << _away->raceName() << ") : ";
if (_away->coach_id()==""){
out << _away->coach();
}else{
out << "[url=" << _away->coach_url() << "]" << _away->coach() <<"[/url]";
}
out << endl;
}