File indexing completed on 2024-11-24 03:44:59

0001 /*
0002  * Copyright (C) 1998-2002 Tom Holroyd <tomh@kurage.nimh.nih.gov>
0003  * Copyright (C) 2006-2009 Stephan Kulow <coolo@kde.org>
0004  *
0005  * This program is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU General Public License as
0007  * published by the Free Software Foundation; either version 2 of
0008  * the License, or (at your option) any later version.
0009  *
0010  * This program is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017  */
0018 
0019 #ifndef FREECELLSOLVER_H
0020 #define FREECELLSOLVER_H
0021 
0022 // own
0023 #include "abstract_fc_solve_solver.h"
0024 
0025 constexpr auto Nwpiles = 8;
0026 constexpr auto Ntpiles = 4;
0027 class Freecell;
0028 
0029 class FreecellSolver : public FcSolveSolver
0030 {
0031 public:
0032     explicit FreecellSolver(const Freecell *dealer);
0033     int good_automove(int o, int r);
0034     int get_possible_moves(int *a, int *numout) override;
0035 #if 0
0036     bool isWon() override;
0037     void make_move(MOVE *m) override;
0038     void undo_move(MOVE *m) override;
0039     void prioritize(MOVE *mp0, int n) override;
0040     int getOuts() override;
0041     unsigned int getClusterNumber() override;
0042     void translate_layout() override;
0043     void unpack_cluster( unsigned int k ) override;
0044     MoveHint translateMove(const MOVE &m) override;
0045 #endif
0046     void translate_layout() override;
0047 #if 0
0048     virtual void unpack_cluster( unsigned int k );
0049 #endif
0050     MoveHint translateMove(const MOVE &m) override;
0051     void setFcSolverGameParams() override;
0052     int get_cmd_line_arg_count() override;
0053     const char **get_cmd_line_args() override;
0054 #if 0
0055     virtual void print_layout();
0056 
0057     int Nwpiles; /* the numbers we're actually using */
0058     int Ntpiles;
0059 
0060 /* Names of the cards.  The ordering is defined in pat.h. */
0061 
0062     card_t Osuit[4];
0063 
0064 
0065     static int Xparam[];
0066 #endif
0067     card_t O[12]; /* output piles store only the rank or NONE */
0068 
0069     const Freecell *deal;
0070 };
0071 
0072 #endif // FREECELLSOLVER_H