Cluedo Solver v1.0
Cluedo game solver making deductions.
Loading...
Searching...
No Matches
Cluedo::CardSet::iterator Class Reference

An iterator for the CardSet class. More...

#include <CardSet.hpp>

Public Member Functions

constexpr iterator (std::bitset< CardUtils::CARD_COUNT > const &set_ref)
 
constexpr iterator (std::bitset< CardUtils::CARD_COUNT > const &set_ref, std::size_t index)
 
constexpr void advance_to_next_index ()
 
constexpr void operator++ ()
 Advances the iterator to the next card in the set.
 
constexpr bool operator== (iterator const &other) const
 
constexpr bool operator!= (iterator const &other) const
 
constexpr Card operator* () const
 Returns the card that the iterator points to.
 

Detailed Description

An iterator for the CardSet class.

Constructor & Destructor Documentation

◆ iterator() [1/2]

Cluedo::CardSet::iterator::iterator ( std::bitset< CardUtils::CARD_COUNT > const & set_ref)
inlineconstexpr

Constructs an iterator that points to the first card of the set.

Parameters
set_refThe reference to the set.

◆ iterator() [2/2]

Cluedo::CardSet::iterator::iterator ( std::bitset< CardUtils::CARD_COUNT > const & set_ref,
std::size_t index )
inlineconstexpr

Constructs an iterator that points to the card of the set with the index given.

Note
If the card at index is not in the set then the iterator will point to the next card in the set.
Parameters
set_refThe reference to the set.
indexThe index of the element of the set.

Member Function Documentation

◆ advance_to_next_index()

void Cluedo::CardSet::iterator::advance_to_next_index ( )
inlineconstexpr

If the current index does not point to a card in the set, then it advances the iterator to the next card in the set.

◆ operator!=()

bool Cluedo::CardSet::iterator::operator!= ( iterator const & other) const
inlineconstexpr

Compares two iterators.

Parameters
otherThe other iterator.
Returns
false if the set they reference is the same and they point to the same card, true otherwise.

◆ operator==()

bool Cluedo::CardSet::iterator::operator== ( iterator const & other) const
inlineconstexpr

Compares two iterators.

Parameters
otherThe other iterator.
Returns
true if the set they reference is the same and they point to the same card, false otherwise.

The documentation for this class was generated from the following file: