I have a strange C++ class as shown below. I would like to write equivalence of this class in C# but I am in trouble.
class Map
{
public:
class Cell
{
public:
class Hash : public unary_function<Cell*, size_t>
{
public:
static const int C;
size_t operator()(Cell* c) const;
};
static const unsigned int NUM_NBRS;
static const double COST_UNWALKABLE;
double cost;
Cell(unsigned int x, unsigned int y, double cost = 1.0);
~Cell();
void init(Cell** nbrs);
Cell** nbrs();
unsigned int x();
unsigned int y();
protected:
bool _init;
Cell** _nbrs;
unsigned int _x;
unsigned int _y;
};
Map(unsigned int rows, unsigned int cols);
~Map();
Cell* operator()(const unsigned int row, const unsigned int col);
unsigned int cols();
bool has(unsigned int row, unsigned int col);
unsigned int rows();
protected:
Cell*** _cells;
unsigned int _cols;
unsigned int _rows;
};
How it can be converted to C#? Speacially I am confused Hash class which inherits unary_function