00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __DISASSEMBLER_A_H__
00022 #define __DISASSEMBLER_A_H__
00023
00024 #include "disassembler.h"
00025 #include "movementanalysator.h"
00026
00027 #include <vector>
00028
00029 class grouping_c;
00030 class problem_c;
00031 class disassemblerNode_c;
00032 class assembly_c;
00033
00047 class disassembler_a_c : public disassembler_c {
00048
00049 private:
00050
00054 grouping_c * groups;
00055
00059 const problem_c * puzzle;
00060
00066 unsigned short * piece2shape;
00067
00073 movementAnalysator_c *analyse;
00074
00075 unsigned short subProbGroup(const disassemblerNode_c * st, const std::vector<unsigned int> & pn, bool cond);
00076 bool subProbGrouping(const std::vector<unsigned int> & pn);
00077
00078 separation_c * checkSubproblem(int pieceCount, const std::vector<unsigned int> & pieces, const disassemblerNode_c * st, bool left, bool * ok);
00079
00080 protected:
00081
00083 void init_find(disassemblerNode_c * nd, const std::vector<unsigned int> & pieces) {
00084 analyse->init_find(nd, pieces);
00085 }
00086
00088 disassemblerNode_c * find(void) { return analyse->find(); }
00089
00096 separation_c * checkSubproblems(const disassemblerNode_c * st, const std::vector<unsigned int> &pieces);
00097
00099 virtual separation_c * disassemble_rec(const std::vector<unsigned int> & pieces, disassemblerNode_c * start) = 0;
00100
00101 public:
00102
00108 disassembler_a_c(const problem_c *puz);
00109 ~disassembler_a_c(void);
00110
00120 separation_c * disassemble(const assembly_c * assembly);
00121
00122 private:
00123
00124
00125 disassembler_a_c(const disassembler_a_c&);
00126 void operator=(const disassembler_a_c&);
00127 };
00128
00129 #endif