|
From: Markus R. <god...@us...> - 2009-07-29 15:35:32
|
Module: performous
Branch: master
Commit: 2c28ed836d40f48266c611aa669a3ebefc1fdd0b
Author: Markus Raab <un...@ma...>
Date: Fri Jul 24 22:17:11 2009 +0200
sorting by score
---
game/player.hh | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/game/player.hh b/game/player.hh
index 8c49384..6335ec9 100644
--- a/game/player.hh
+++ b/game/player.hh
@@ -40,4 +40,9 @@ struct Player {
int getScore() const {
return 10000.0 * m_score;
}
+ /**Operator for sorting by score.*/
+ bool operator < (Player const& other) const
+ {
+ return other.m_score < m_score;
+ }
};
|