mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2024-12-25 21:59:30 +01:00
RackWidget: filter the rack correctly when the played word contains a blank
This commit is contained in:
parent
94b2b520d1
commit
d9ee0633db
1 changed files with 7 additions and 9 deletions
|
@ -18,6 +18,8 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include <QtGui/QHBoxLayout>
|
#include <QtGui/QHBoxLayout>
|
||||||
#include <QtGui/QDragEnterEvent>
|
#include <QtGui/QDragEnterEvent>
|
||||||
#include <QtGui/QDragLeaveEvent>
|
#include <QtGui/QDragLeaveEvent>
|
||||||
|
@ -151,15 +153,11 @@ vector<Tile> RackWidget::filterRack(const vector<Tile> &iTiles) const
|
||||||
if (round.isPlayedFromRack(i))
|
if (round.isPlayedFromRack(i))
|
||||||
{
|
{
|
||||||
const Tile &t = round.getTile(i);
|
const Tile &t = round.getTile(i);
|
||||||
vector<Tile>::iterator it;
|
vector<Tile>::iterator it =
|
||||||
for (it = result.begin(); it != result.end(); ++it)
|
std::find(result.begin(), result.end(),
|
||||||
{
|
t.isJoker() ? Tile::Joker() : t);
|
||||||
if (*it == t)
|
if (it != result.end())
|
||||||
{
|
result.erase(it);
|
||||||
result.erase(it);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue