Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
KsirK
Commits
4ceef61e
Commit
4ceef61e
authored
Mar 22, 2007
by
Gaël de Chalendar
Browse files
Corrected many problems reported by the ebn
svn path=/trunk/playground/games/ksirk/; revision=645585
parent
5130ce2b
Changes
74
Hide whitespace changes
Inline
Side-by-side
ksirk/Dialogs/kplayersetupdialog.cpp
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#define KDE_NO_COMPAT
#include
"kplayersetupdialog.h"
...
...
ksirk/Dialogs/kplayersetupdialog.h
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#define KDE_NO_COMPAT
...
...
ksirk/Dialogs/kwaitedplayersetupdialog.cpp
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#define KDE_NO_COMPAT
#include
"kwaitedplayersetupdialog.h"
...
...
ksirk/Dialogs/kwaitedplayersetupdialog.h
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#define KDE_NO_COMPAT
...
...
ksirk/Dialogs/newGameDialogImpl.cpp
View file @
4ceef61e
/***************************************************************************
* newGameDialogImpl.cpp
* -------------------
* begin : Wed Feb 23 2005
* copyright : (C) 2005 by Gael de Chalendar <kleag@free.fr>
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#include
"newGameDialogImpl.h"
#include
"GameLogic/onu.h"
...
...
ksirk/Dialogs/newGameDialogImpl.h
View file @
4ceef61e
...
...
@@ -2,7 +2,7 @@
newGameDialogImpl.h - description
-------------------
begin : Wed Feb 23 2005
copyright : (C) 2005 by Ga
ë
l de Chalendar
copyright : (C) 2005 by Ga
e
l de Chalendar
email : kleag@free.fr
***************************************************************************/
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#define KDE_NO_COMPAT
...
...
ksirk/Dialogs/restartOrExitDialogImpl.cpp
View file @
4ceef61e
/* This file is part of KsirK.
* Copyright (C) 2007 Gael de Chalendar <kleag@free.fr>
*
* KsirK is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*/
#include
"restartOrExitDialogImpl.h"
#include
<klocale.h>
...
...
ksirk/Dialogs/restartOrExitDialogImpl.h
View file @
4ceef61e
...
...
@@ -2,7 +2,7 @@
restartOrExitDialogImpl.h - description
-------------------
begin : Sun Jul 16 2006
copyright : (C) 2006 by Ga
ë
l de Chalendar (aka Kleag)
copyright : (C) 2006 by Ga
e
l de Chalendar (aka Kleag)
email : kleag@free.fr
***************************************************************************/
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#define KDE_NO_COMPAT
...
...
ksirk/GameLogic/KMessageParts.cpp
View file @
4ceef61e
//
// C++ Implementation: kstringvector
//
// Description:
//
//
// Author: Gaël de Chalendar (aka Kleag) <kleag@free.fr>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
/**
C++ Implementation: kstringvector
Description:
Author: Gael de Chalendar (aka Kleag) <kleag@free.fr>, (C) 2005
Copyright: See COPYING file that comes with this distribution
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
*/
#include
"KMessageParts.h"
#include
"kdebug.h"
...
...
ksirk/GameLogic/KMessageParts.h
View file @
4ceef61e
...
...
@@ -2,7 +2,7 @@
kstringvector.h - description
-------------------
begin : Mon Sep 26 2005
copyright : (C) 2005-2007 by Ga
ë
l de Chalendar (aka Kleag)
copyright : (C) 2005-2007 by Ga
e
l de Chalendar (aka Kleag)
email : kleag@free.fr
***************************************************************************/
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#ifndef KSIRK_GAMELOGICKMESSAGEPARTS_H
...
...
ksirk/GameLogic/KsirkChatDelegate.cpp
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#include
"KsirkChatDelegate.h"
...
...
ksirk/GameLogic/KsirkChatDelegate.h
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#ifndef KSIRKCHATDELEGATE_H
...
...
ksirk/GameLogic/KsirkChatItem.cpp
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#include
"KsirkChatItem.h"
...
...
ksirk/GameLogic/KsirkChatItem.h
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#ifndef KSIRKCHATITEM_H
...
...
ksirk/GameLogic/KsirkChatModel.cpp
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#include
<qlayout.h>
#include
<qapplication.h>
...
...
ksirk/GameLogic/KsirkChatModel.h
View file @
4ceef61e
...
...
@@ -2,7 +2,7 @@
KsirkChatItem.h - description
-------------------
begin : Mon Sep 26 2006
copyright : (C) 2006-2007 by Ga
ë
l de Chalendar (aka Kleag)
copyright : (C) 2006-2007 by Ga
e
l de Chalendar (aka Kleag)
email : kleag@free.fr
***************************************************************************/
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
#ifndef KSIRKCHATMODEL_H
...
...
ksirk/GameLogic/aiColsonPlayer.cpp
View file @
4ceef61e
// kate: space-indent on; indent-width 2; replace-tabs on;
/* This file is part of KsirK.
Copyright (C) 2006-2007 Ga
ë
l de Chalendar <kleag@free.fr>
Copyright (C) 2006-2007 Ga
e
l de Chalendar <kleag@free.fr>
This file was initialy part of XFrisk
Copyright (C) 1995 and later Jean-Claude Colson and Others
...
...
@@ -14,11 +14,11 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program;
see the file COPYING. If not, write to
the Free Software
Foundation, Inc., 5
9 Temple Place - Suite 330,
Boston, MA
0211
1
-130
7
, USA
.
*/
*
You should have received a copy of the GNU General Public License
*
along with this program;
if not, write to the Free Software
*
Foundation, Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA
*
0211
0
-130
1
, USA
*/
/***********************************************************************
*
* 18-8-95 Created by Jean-Claude Colson.
...
...
ksirk/GameLogic/aiColsonPlayer.h
View file @
4ceef61e
// kate: space-indent on; indent-width 2; replace-tabs on;
/* This file is part of KsirK.
Copyright (C) 2006-2007 Ga
ë
l de Chalendar <kleag@free.fr>
/*
*
This file is part of KsirK.
Copyright (C) 2006-2007 Ga
e
l de Chalendar <kleag@free.fr>
This file was initialy part of XFrisk
Copyright (C) 1995 and later Jean-Claude Colson and Others
...
...
@@ -15,9 +15,9 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program;
see the file COPYING. If not, write to
the Free Software
Foundation, Inc., 5
9 Temple Place - Suite 330,
Boston, MA
0211
1
-130
7
, USA
.
along with this program;
if not, write to the Free Software
Foundation, Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA
0211
0
-130
1
, USA
*/
#ifndef KSIRK_GAMELOGIC_AICOLSONPLAYER_H
...
...
@@ -77,7 +77,7 @@ public:
/**
* Chooses the next action. In the current basic setting, chooses at random
* between the three possibilities. For each, chooses randomly the
* parameters.If the randomly cho
o
sen parameters end by an impossible
* parameters.If the randomly chosen parameters end by an impossible
* action, continue with next player.
*/
virtual
void
chooseAttackMoveArmiesOrNextPlayer
();
...
...
ksirk/GameLogic/aiplayer.cpp
View file @
4ceef61e
...
...
@@ -13,6 +13,10 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
***************************************************************************/
/* Local includes */
...
...
@@ -70,7 +74,7 @@ AIPlayer :: AIPlayer(
/**
* This function is called whenever the player should choose an action (
* attack, defense, etc.). It has the respons
a
bility to choose the correct
* attack, defense, etc.). It has the respons
i
bility to choose the correct
* action depending on the state of the game.
*/
void
AIPlayer
::
actionChoice
(
GameLogic
::
GameAutomaton
::
GameState
state
)
...
...
@@ -153,7 +157,7 @@ void AIPlayer::actionChoice(GameLogic::GameAutomaton::GameState state)
/**
* Chooses the next action. In the current basic setting, chooses at random
* between the three possibilities. For each, chooses randomly the parameters.
* If the randomly cho
o
sen parameters end by an impossible action, continue
* If the randomly chosen parameters end by an impossible action, continue
* with next player.
*/
void
AIPlayer
::
chooseAttackMoveArmiesOrNextPlayer
()
...
...
@@ -335,7 +339,7 @@ bool AIPlayer::attackAction()
uint
nbAttack
=
0
;
if
(
srcNbArmies
==
1
)
{
kError
()
<<
"AI player "
<<
Player
::
name
()
<<
" country "
<<
m_src
->
nbArmies
()
<<
"have only one army. Should not be cho
o
se
d
to attack."
<<
endl
;
kError
()
<<
"AI player "
<<
Player
::
name
()
<<
" country "
<<
m_src
->
nbArmies
()
<<
"have only one army. Should not be chose
n
to attack."
<<
endl
;
exit
();
}
if
(
srcNbArmies
>=
2
)
{
nbAttack
=
1
;}
...
...
ksirk/GameLogic/aiplayer.h
View file @
4ceef61e
/* This file is part of KsirK.
Copyright (C) 2002-2007 Ga
ë
l de Chalendar <kleag@free.fr>
Copyright (C) 2002-2007 Ga
e
l de Chalendar <kleag@free.fr>
KsirK is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
...
...
@@ -11,9 +11,9 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program;
see the file COPYING. If not, write to
the Free Software
Foundation, Inc., 5
9 Temple Place - Suite 330,
Boston, MA
0211
1
-130
7
, USA
.
along with this program;
if not, write to the Free Software
Foundation, Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA
0211
0
-130
1
, USA
*/
#ifndef AIPLAYER_H
...
...
@@ -77,14 +77,14 @@ public:
/**
* Saves this AI player as XML. Used in game saving.
* @param xmlStream The stream on wich to write the XML
* @param xmlStream The stream on w
h
ich to write the XML
*/
virtual
void
saveXml
(
std
::
ostream
&
xmlStream
);
protected:
/**
* This function is called whenever the player should choose an action
* (attack, defense, etc.). It has the respons
a
bility to choose the correct
* (attack, defense, etc.). It has the respons
i
bility to choose the correct
* action depending on the state of the game.
*/
virtual
void
actionChoice
(
GameLogic
::
GameAutomaton
::
GameState
state
);
...
...
@@ -96,7 +96,7 @@ protected:
/**
* Chooses the next action. In the current basic setting, chooses at random
* between the three possibilities. For each, chooses randomly the
* parameters.If the randomly cho
o
sen parameters end by an impossible
* parameters.If the randomly chosen parameters end by an impossible
* action, continue with next player.
*/
virtual
void
chooseAttackMoveArmiesOrNextPlayer
();
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment