#include <disassembly.h>
Public Member Functions | |
state_c (unsigned int pn) | |
create a new spate for pn pieces. | |
state_c (const state_c *cpy, unsigned int pn) | |
copy constructor | |
state_c (xmlParser_c &pars, unsigned int pn) | |
load from an xml node | |
~state_c () | |
void | save (xmlWriter_c &xml, unsigned int piecenumber) const |
save into an xml node | |
void | set (unsigned int piece, int x, int y, int z) |
set the position of a piece | |
int | getX (unsigned int i) const |
get the x position of a piece | |
int | getY (unsigned int i) const |
get the y position of a piece | |
int | getZ (unsigned int i) const |
get the z position of a piece | |
bool | pieceRemoved (unsigned int i) const |
check, if the piece is removed in this state | |
unsigned int | getPiecenumber (void) const |
on assert needs to check the piecenumber | |
Private Member Functions | |
state_c (const state_c &) | |
void | operator= (const state_c &) |
Private Attributes | |
int * | dx |
contains the x positions of all the pieces that are handled | |
int * | dy |
contains the y positions of all the pieces that are handled | |
int * | dz |
contains the z positions of all the pieces that are handled | |
unsigned int | piecenumber |
we only keep the piecenumber for checking purposes |
one state of relative piece positions on your way
state_c::state_c | ( | unsigned int | pn | ) |
create a new spate for pn pieces.
you can not add more pieces later on, so plan ahead
References bt_assert.
state_c::state_c | ( | const state_c * | cpy, | |
unsigned int | pn | |||
) |
state_c::state_c | ( | xmlParser_c & | pars, | |
unsigned int | pn | |||
) |
load from an xml node
References dx, dy, dz, xmlParser_c::END_TAG, xmlParser_c::exception(), xmlParser_c::getName(), getNumbers(), xmlParser_c::getText(), xmlParser_c::next(), xmlParser_c::nextTag(), piecenumber, xmlParser_c::require(), xmlParser_c::START_TAG, and xmlParserException_c::what().
state_c::state_c | ( | const state_c & | ) | [private] |
unsigned int state_c::getPiecenumber | ( | void | ) | const [inline] |
on assert needs to check the piecenumber
References piecenumber.
Referenced by separation_c::addstate().
int state_c::getX | ( | unsigned int | i | ) | const [inline] |
get the x position of a piece
References bt_assert, dx, and piecenumber.
Referenced by disasmToMoves_c::doRecursive(), and print_rec().
int state_c::getY | ( | unsigned int | i | ) | const [inline] |
get the y position of a piece
References bt_assert, dy, and piecenumber.
Referenced by disasmToMoves_c::doRecursive(), and print_rec().
int state_c::getZ | ( | unsigned int | i | ) | const [inline] |
get the z position of a piece
References bt_assert, dz, and piecenumber.
Referenced by disasmToMoves_c::doRecursive(), and print_rec().
void state_c::operator= | ( | const state_c & | ) | [private] |
bool state_c::pieceRemoved | ( | unsigned int | i | ) | const |
check, if the piece is removed in this state
References bt_assert, dx, dy, dz, and piecenumber.
Referenced by disasmToMoves_c::doRecursive().
void state_c::save | ( | xmlWriter_c & | xml, | |
unsigned int | piecenumber | |||
) | const |
save into an xml node
References xmlWriter_c::addContent(), dx, dy, dz, xmlWriter_c::endTag(), and xmlWriter_c::newTag().
void state_c::set | ( | unsigned int | piece, | |
int | x, | |||
int | y, | |||
int | z | |||
) |
set the position of a piece
References bt_assert, dx, dy, dz, and piecenumber.
Referenced by disassembler_a_c::checkSubproblems().
int* state_c::dx [private] |
contains the x positions of all the pieces that are handled
Referenced by getX(), pieceRemoved(), save(), set(), state_c(), and ~state_c().
int* state_c::dy [private] |
contains the y positions of all the pieces that are handled
Referenced by getY(), pieceRemoved(), save(), set(), state_c(), and ~state_c().
int* state_c::dz [private] |
contains the z positions of all the pieces that are handled
Referenced by getZ(), pieceRemoved(), save(), set(), state_c(), and ~state_c().
unsigned int state_c::piecenumber [private] |
we only keep the piecenumber for checking purposes
Referenced by getPiecenumber(), getX(), getY(), getZ(), pieceRemoved(), set(), and state_c().