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
|
class athlete {
private:
string name;
public:
athlete (string athlete_name) { name=athlete_name; }
};
class event
{
private:
string etitle;
string organizer;
string place;
date_time when;
int official;
sport *game;
event *next;
public:
event (string event_title, string org, int event_year, int event_day, int event_hour, int event_minute, string plc, int offic, sport *s)
{
etitle=event_title;
organizer=org;
when.y=event_year; when.m=event_month; when.d=event_day; when.hh=event_hour; when.mm=event_minute;
place=plc;
official=offic;
game=s;
next=nullptr;
}
void connect (event *e) { next=e; }
};
class individual_sport : public event {
private:
athlete *the_participant;
public:
individual_sport(string event_title, string org, int event_year, int event_day, int event_hour, int event_minute, string plc, int offic, sport *s, athlete *t): event(event_title, org, event_year, event_day, event_hour, event_minute, plc, offic, s), the_participant(t) {}
};
class team_sport : public event
{
private:
athlete *the_team;
public:
team_sport (string event_title, string org, int event_year, int event_day, int event_hour, int event_minute, string plc, int offic, sport *s, athlete *t) : event(event_title, org, event_year, event_day, event_hour, event_minute, plc, offic, s), the_team(t) {}
}
|