60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
#include <array>
|
|
#include <vector>
|
|
|
|
namespace queens
|
|
{
|
|
// Easy way represent a conflict:
|
|
struct Conflict
|
|
{
|
|
int piece_1;
|
|
int piece_1_x;
|
|
int piece_1_y;
|
|
int piece_2;
|
|
int piece_2_x;
|
|
int piece_2_y;
|
|
};
|
|
class Piece
|
|
{
|
|
public:
|
|
int x;
|
|
int y;
|
|
|
|
Piece(int x, int y);
|
|
};
|
|
class Queen: public Piece
|
|
{
|
|
using Piece::Piece;
|
|
};
|
|
|
|
class Board
|
|
{
|
|
public:
|
|
int m;
|
|
int n;
|
|
};
|
|
|
|
class Configuration
|
|
{
|
|
public:
|
|
int number_of_pieces;
|
|
std::vector<Piece> pieces;
|
|
Board* board;
|
|
|
|
Configuration(int m, int n, int number_of_pieces);
|
|
~Configuration();
|
|
|
|
// I could not get copy constructor and copy assignment operator to work :/
|
|
//Configuration(Configuration& t);
|
|
/*
|
|
|
|
Configuration& operator=(const Configuration& rhs)
|
|
{
|
|
this->board = rhs.board;
|
|
return *this;
|
|
}
|
|
*/
|
|
std::vector<Conflict> get_conflicts();
|
|
};
|
|
|
|
|
|
} |