Mari's Tarot
 All Classes Files Functions Variables Enumerations Enumerator Friends
Team.hpp
Go to the documentation of this file.
1 /*
2  * Tarot is an application for Android system to play to French Tarot.
3  * Please visit https://github.com/richoux/Tarot for further information.
4  *
5  * Copyright (C) 2013-2016 Florian Richoux
6  *
7  * This file is part of Tarot.
8  * Tarot is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * Tarot is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License
19  * along with Tarot. If not, see http://www.gnu.org/licenses/.
20  */
21 
22 #pragma once
23 
24 #include <map>
25 #include <memory>
26 
27 #include "Player.hpp"
28 
29 using namespace std;
30 
32 class Team
33 {
35  friend ostream& operator<< ( ostream&, const Team& );
36 
37 public:
39 
43  inline bool contains ( const string& name ) const { return members.find( name ) != members.end(); }
44 
46  double getScore() const;
47 
49  bool isEmpty() const;
50 
52  void newGame();
53 
55  bool operator>( const Team& t ) const;
56 
58  bool operator<( const Team& t ) const;
59 
60 
61  map<string, shared_ptr<Player> > members;
62 };
Team is the class handling team management.
Definition: Team.hpp:32
bool contains(const string &name) const
Inline function to test if a player belongs to this team.
Definition: Team.hpp:43
ostream & operator<<(ostream &os, const Card &card)
Definition: Card.cpp:74
map< string, shared_ptr< Player > > members
A map of team members, to quickly have an hand on the player object knowing his/her name...
Definition: Team.hpp:61