资源简介
利用JAVA实现人与人玩CHESS。其中有各种角色的ROLE还有各种角色MOVE的方法
代码片段和文件信息
/*
GameController - A class to control the game of chess.
Copyright (C) 2003 The Java-Chess team
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.
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. 59 Temple Place - Suite 330 Boston MA 02111-1307 USA.
*/
package de.java_chess.javaChess;
import de.java_chess.javaChess.board.*;
import de.java_chess.javaChess.dialogs.*;
import de.java_chess.javaChess.engine.*;
import de.java_chess.javaChess.game.*;
import de.java_chess.javaChess.notation.*;
import de.java_chess.javaChess.piece.*;
import de.java_chess.javaChess.ply.*;
import de.java_chess.javaChess.position.*;
import de.java_chess.javaChess.renderer.ChessBoardRenderer;
import de.java_chess.javaChess.timer.*;
import javax.swing.*;
/**
* This class controls the game.
*/
public class GameController {
// Instance variables
/**
* The current game.
*/
private Game _game;
/**
* The game notation.
*/
private GameNotation _gameNotation;
/**
* A flag to indicate if white has the next move.
*/
private boolean _moveRight = true;
/**
* A flag to indicate if the computer play with white pieces.
*/
private boolean _computerIsWhite = false;
/**
* The chess engine.
*/
private ChessEngine _engine;
/**
* The current board.
*/
private Board _board;
/**
* The renderer.
*/
ChessBoardRenderer _renderer;
/**
* The timer for the game.
*/
GameTimer _gameTimer;
/**
* The current game state.
*/
byte _gameState;
// Constructors
/**
* Create a new controller instance.
*
* @param game The current game.
* @param gameNotation The notation of the game.
* @param engine The current engine.
* @param board The current board.
* @param timer The game timer.
*/
public GameController( Game game GameNotation gameNotation ChessEngine engine Board board GameTimer timer) {
setGame( game);
setGameNotation( gameNotation);
setEngine( engine);
setBoard( board);
setGameTimer( timer);
}
// Methods
/**
* Get the current game.
*
* @return The current game.
*/
public final Game getGame() {
return _game;
}
/**
* Set the current game.
*
* @param The current game.
*/
public final void setGame( Game game) {
_game = game;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 92197 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\build\javaChess.jar
..AD... 0 2005-07-28 17:30 200582312425051\一个java做的国际象棋小游戏\build
文件 5426 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\allclasses-fr
文件 10592 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\action\JavaChessAction.html
文件 992 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\action\package-fr
文件 5118 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\action\package-summary.html
文件 5152 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\action\package-tree.html
文件 11963 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\action\SaveGameAction.html
文件 11916 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\action\SaveGameAsAction.html
..AD... 0 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\action
文件 25049 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\bitboard\BitBoard.html
文件 20447 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\bitboard\BitBoardImpl.html
文件 1081 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\bitboard\package-fr
文件 5186 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\bitboard\package-summary.html
文件 5219 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\bitboard\package-tree.html
..AD... 0 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\bitboard
文件 11366 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\board\Board.html
文件 827 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\board\package-fr
文件 4746 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\board\package-summary.html
文件 4688 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\board\package-tree.html
..AD... 0 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\board
文件 13527 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\BitBoardAnalyzer.html
文件 16649 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\BitBoardAnalyzerImpl.html
文件 8465 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\BitUtils.html
文件 12851 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\ChessEngine.html
文件 23202 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\ChessEngineImpl.html
文件 967 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\hashtable\package-fr
文件 5071 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\hashtable\package-summary.html
文件 4931 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\hashtable\package-tree.html
文件 9719 2003-02-24 09:36 200582312425051\一个java做的国际象棋小游戏\docs\javadoc\de\java_chess\javaChess\engine\hashtable\PlyHashtable.html
............此处省略221个文件信息
评论
共有 条评论