#ifndef MAZEGAMED2SOLVER01_H
#define MAZEGAMED2SOLVER01_H

#include <set>
using namespace std;

#include <mazegameD2state01.h>
#include <typedefs.h>


/*!
\brief Solve D2 maze - rough solution.
*/
class mazegameD2solver01
{
public:
  /** State. */
  mazegameD2state01 & mg;
  /** */
  vector< cellD2<uint> > & vi;

  /** Constructor. */
  mazegameD2solver01(mazegameD2state01 & mg_);

  //typedef set<uint,less<uint> > uintset;
  typedef set<uint> uintset;
  /** List of visited cells. */
  uintset visited;

  /** Is the cell already on the path? */
  boolc pathcontains(uintc k) const;

  /** Set to beginning of game. */
  void reset();
  
  /** Invalid if already found solution or no more moves. */
  boolc operator ! () const;

  /** Next step. */
  void operator ++ ();
};


#endif


