Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
velnias75 committed Nov 28, 2014
1 parent 903a238 commit fcb4be3
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 22 deletions.
6 changes: 3 additions & 3 deletions doc/client.dox.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ PROJECT_BRIEF = "Client API"
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.

PROJECT_LOGO =
#PROJECT_LOGO = @top_srcdir@/netmaumau.ico

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
Expand Down Expand Up @@ -946,13 +946,13 @@ STRIP_CODE_COMMENTS = YES
# function all documented functions referencing it will be listed.
# The default value is: NO.

REFERENCED_BY_RELATION = NO
REFERENCED_BY_RELATION = YES

# If the REFERENCES_RELATION tag is set to YES then for each documented function
# all documented entities called/used by that function will be listed.
# The default value is: NO.

REFERENCES_RELATION = NO
REFERENCES_RELATION = YES

# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
Expand Down
17 changes: 9 additions & 8 deletions src/engine/stdplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include <cstring>
#include <numeric>

#include "stdplayer.h"

Expand Down Expand Up @@ -80,6 +81,13 @@ struct playedOutRank : std::binary_function<std::string, NetMauMau::Common::ICar
return false;
}
};

struct pointSum : std::binary_function<std::size_t, NetMauMau::Common::ICard *, std::size_t> {
std::size_t operator()(std::size_t i, const NetMauMau::Common::ICard *c) const {
return i + c->getPoints();
}
};

#pragma GCC diagnostic pop

}
Expand Down Expand Up @@ -461,14 +469,7 @@ std::size_t StdPlayer::getCardCount() const {
}

std::size_t StdPlayer::getPoints() const {

std::size_t pts = 0;

for(CARDS::const_iterator i(m_cards.begin()); i != m_cards.end(); ++i) {
pts += (*i)->getPoints();
}

return pts;
return std::accumulate(m_cards.begin(), m_cards.end(), 0, pointSum());
}

const StdPlayer::CARDS &StdPlayer::getPlayerCards() const {
Expand Down
25 changes: 15 additions & 10 deletions src/include/abstractclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
* NetMauMau::Client::AbstractClient. @n Useful functions you'll find in NetMauMau::Common.
*
* Link your client against @c -lnetmaumauclient and @c -lnetmaumaucommon
*
* The rules and points you can find @ref rules "here".
*
* You can grab the latest source code at https://github.com/velnias75/NetMauMau\n
* You can grab the latest source code from https://github.com/velnias75/NetMauMau or
* https://sourceforge.net/projects/netmaumau\n
* A proof of concept Qt client can be found at https://github.com/velnias75/NetMauMau-Qt-Client
*
* @page rules Rules
Expand All @@ -49,46 +52,49 @@
* can play out any card of either the same rank or the same suit. If a player cannot play out
* any card the player has to take one from the pool and to suspend. Some cards trigger specific
* actions as described below.
*
* If a player has lost the points of the player's cards are summed up. The higher that value
* the worse the game is lost.
*
* Specific card rules
* -------------------
*
* All rules apply also to the visible card at the beginning of the game for the first player.
*
* * **Seven**
* * **Seven** (1 Point)
*
* if a *Seven* is played out than the next player has either to take two more cards or play
* out another *Seven*. In that case the next player has either to take plus two (i.e. four)
* cards or can also play out a *Seven* and so forth. At maximum one player has to take eight
* cards if a sequence of four *Seven* are played out
*
* * **Eight**
* * **Eight** (2 Points)
*
* if an *Eight* is played out, the next player has to suspend and the next player can play
* a card. The player has **not** to take an extra card. An *Eight* played before takes
* precedence, i.e. even if the next player has an *Eight*, the player has to suspend
*
* * **Nine**
* * **Nine** (3 Points)
*
* there is no special rule for that rank
*
* * **Ten**
* * **Ten** (4 Points)
*
* there is no special rule for that rank
*
* * **Queen**
* * **Queen** (5 Points)
*
* there is no special rule for that rank
*
* * **King**
* * **King** (6 Points)
*
* there is no special rule for that rank
*
* * **Ace**
* * **Ace** (11 Points)
*
* there is no special rule for that rank
*
* * **Jack**
* * **Jack** (20 Points)
*
* if a *Jack* of any suite is played out, the player can wish a new suit. A *Jack* can get
* played over any card except another *Jack*. An *Eight* played before takes precedence, i.e.
Expand Down Expand Up @@ -408,7 +414,6 @@ class _EXPORT AbstractClient {
* taking card a is not possible
*
* @param enable @c true if it is possible to take a card, @c false otherwise
* @return void
*/
virtual void enableSuspend(bool enable) const = 0;

Expand Down
13 changes: 13 additions & 0 deletions src/include/cardtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,19 @@ _EXPORT NetMauMau::Common::ICard *getIllegalCard() _CONST;
/**
* @brief Gets the points of a @c RANK
*
* Rank | Points
* ------: | :-----
* Seven | 1
* Eight | 2
* Nine | 3
* Ten | 4
* Queen | 5
* King | 6
* Ace | 11
* Jack | 20
*
* @see Common::ICard::getPoints
*
* @param rank the @c RANK
* @return std::size_t the points of a @c RANK
*/
Expand Down
2 changes: 1 addition & 1 deletion src/include/icard.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class _EXPORT ICard {

/**
* @brief Gets the points of the card
*
* @see Common::getCardPoints
* @return std::size_t the points of the card
*/
virtual std::size_t getPoints() const = 0;
Expand Down

0 comments on commit fcb4be3

Please sign in to comment.