// return a new set containing only one instance of each clone Tiles Tiles::UniqueTiles(void) const { Tiles result; ConstIterator i_tile; for (i_tile = begin(); i_tile != end(); i_tile++) { Tile const tile = *i_tile; if (!result.ContainsOpt(tile)) { result.Add(tile); } } return result; }
Tiles Tiles::PullRandomTiles(SizeType tileCnt) { Tiles result; for (SizeType i_tile = 0; i_tile < tileCnt; i_tile++) { if (IsEmpty()) { break; } Tile const tile = PullRandomTile(); result.Add(tile); } return result; }