]>
jfr.im git - irc/gameservirc.git/blob - gameserv/toplist.cpp
13 toplist::toplist(int c
)
25 void toplist::insertPlayer(Player
*p
)
28 pw
= new PlayerWrapper(p
);
29 myList
.push_front(*pw
);
32 // Reverse the list since list::sort() uses the < operator
37 void toplist::setCount(int c
)
47 void toplist::reverse()
53 list
<PlayerWrapper
>::iterator it
;
56 for (int x
= 0; it
!= myList
.end(); x
++, it
++)
60 // Delete this player from the top list, because they're over the count
66 list
<PlayerWrapper
>::iterator
toplist::begin()
68 return myList
.begin();
72 list
<PlayerWrapper
>::iterator
toplist::end()
79 return myList
.empty();
82 bool PlayerWrapper::operator < (PlayerWrapper
&right
)
84 return (*p
< *right
.p
);
87 PlayerWrapper::PlayerWrapper()
92 PlayerWrapper::PlayerWrapper(Player
*pl
)
97 PlayerWrapper::~PlayerWrapper()
102 void PlayerWrapper::setPlayer(Player
*pl
)