Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
chess
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9611046
chess
Commits
43a94b5a
Commit
43a94b5a
authored
Jul 01, 2019
by
9611046
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation
parent
72f9a332
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
16 deletions
+10
-16
Main.java
src/game/Main.java
+1
-1
Square.java
src/game/Square.java
+6
-4
King.java
src/pieces/King.java
+1
-3
Pawn.java
src/pieces/Pawn.java
+1
-4
Piece.java
src/pieces/Piece.java
+1
-4
No files found.
src/game/Main.java
View file @
43a94b5a
...
...
@@ -288,7 +288,7 @@ public class Main extends JFrame implements MouseListener {
inDanger
=
false
;
//Selecting a square
//Selecting a square
if
(!
select
)
{
((
Square
)
(
e
.
getSource
())).
selectSquare
();
}
else
{
...
...
src/game/Square.java
View file @
43a94b5a
...
...
@@ -13,10 +13,10 @@ public class Square extends JButton {
private
int
x
;
private
int
y
;
private
Piece
piece
;
private
boolean
isSelected
=
false
;
private
boolean
hasPiece
=
false
;
private
boolean
isSelected
;
private
boolean
hasPiece
;
private
JLabel
image
;
private
boolean
possibleSquare
=
false
;
private
boolean
possibleSquare
;
/**
*
...
...
@@ -26,7 +26,9 @@ public class Square extends JButton {
public
Square
(
int
x
,
int
y
){
this
.
x
=
x
;
this
.
y
=
y
;
isSelected
=
false
;
hasPiece
=
false
;
possibleSquare
=
false
;
}
...
...
src/pieces/King.java
View file @
43a94b5a
...
...
@@ -266,8 +266,6 @@ public class King extends Piece {
}
public
boolean
isCheckMate
(
Square
[][]
squares
){
return
false
;
}
}
src/pieces/Pawn.java
View file @
43a94b5a
...
...
@@ -72,8 +72,5 @@ public class Pawn extends Piece {
}
// @Override
// public ArrayList<Square> move() {
// return null;
// }
}
src/pieces/Piece.java
View file @
43a94b5a
...
...
@@ -14,10 +14,8 @@ private String pieceColor;
private
String
imagePath
;
//possibleSquares is protected in Piece class therefore subclasses have access to it
//for all subclasses used one arrayList and before using it in each class content will be cleared
private
ArrayList
<
Square
>
possibleSquares
=
new
ArrayList
<>();
...
...
@@ -50,5 +48,4 @@ private ArrayList<Square> possibleSquares = new ArrayList<>();
public
abstract
ArrayList
<
Square
>
move
(
Square
[][]
boardSquares
,
int
x
,
int
y
);
// public abstract ArrayList<Square> move();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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