File indexing completed on 2024-11-24 03:43:16
0001 /******************************************************************* 0002 * 0003 * Copyright 2007 Aron Boström <c02ab@efd.lth.se> 0004 * 0005 * Bovo is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2, or (at your option) 0008 * any later version. 0009 * 0010 * Bovo 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 Bovo; see the file COPYING. If not, write to 0017 * the Free Software Foundation, 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 * 0020 ********************************************************************/ 0021 0022 0023 /** 0024 * @file aiaron.cc implementing the AiAron class 0025 */ 0026 0027 #include "aiaron.h" 0028 0029 0030 #include "aiboard.h" 0031 #include "coord.h" 0032 #include "dimension.h" 0033 #include "move.h" 0034 0035 using namespace bovo; 0036 0037 /** namespace for AI stuff */ 0038 namespace ai { 0039 0040 AiAron::AiAron(const Dimension& dimension, KGameDifficultyLevel::StandardLevel skill, 0041 Player player) { 0042 m_board = new AiBoard(dimension, skill, player); 0043 m_player = player; 0044 } 0045 0046 AiAron::~AiAron() { 0047 delete m_board; 0048 } 0049 0050 void AiAron::cancelAndWait() { 0051 } 0052 0053 /* public slots */ 0054 0055 void AiAron::changeBoard(const Move& move) { 0056 m_board->setPlayer(move); 0057 } 0058 0059 void AiAron::gameOver() { 0060 } 0061 0062 void AiAron::setSkill(KGameDifficultyLevel::StandardLevel skill) { 0063 m_board->setSkill(skill); 0064 } 0065 0066 void AiAron::slotMove() { 0067 Q_EMIT move(Move(m_player, m_board->move())); 0068 } 0069 0070 } /* namespace ai */ 0071 0072 #include "moc_aiaron.cpp"