Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
agile-java
/
ChessAndroid
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c47028e0
authored
Jun 01, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed strength and representation in pieces
parent
75f9d515
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
19 deletions
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Bishop.java
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Knight.java
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Pawn.java
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Queen.java
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Rook.java
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Bishop.java
View file @
c47028e0
package
com
.
example
.
paktalin
.
agilejava_exercises
.
pieces
;
import
com.example.paktalin.agilejava_exercises.Position
;
import
com.example.paktalin.agilejava_exercises.moves.KingMoveStrategy
;
/**
* Created by Paktalin on 01/06/2018.
...
...
@@ -9,9 +8,8 @@ import com.example.paktalin.agilejava_exercises.moves.KingMoveStrategy;
public
class
Bishop
extends
Piece
{
public
Bishop
(
Piece
.
Color
color
)
{
strength
=
0
;
representation
=
'k'
;
moveStrategy
=
new
KingMoveStrategy
();
strength
=
3
;
representation
=
'b'
;
this
.
color
=
color
;
}
...
...
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Knight.java
View file @
c47028e0
package
com
.
example
.
paktalin
.
agilejava_exercises
.
pieces
;
import
com.example.paktalin.agilejava_exercises.Position
;
import
com.example.paktalin.agilejava_exercises.moves.KingMoveStrategy
;
/**
* Created by Paktalin on 01/06/2018.
...
...
@@ -9,9 +8,8 @@ import com.example.paktalin.agilejava_exercises.moves.KingMoveStrategy;
public
class
Knight
extends
Piece
{
public
Knight
(
Piece
.
Color
color
)
{
strength
=
0
;
representation
=
'k'
;
moveStrategy
=
new
KingMoveStrategy
();
strength
=
2.5
;
representation
=
'n'
;
this
.
color
=
color
;
}
...
...
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Pawn.java
View file @
c47028e0
package
com
.
example
.
paktalin
.
agilejava_exercises
.
pieces
;
import
com.example.paktalin.agilejava_exercises.Position
;
import
com.example.paktalin.agilejava_exercises.moves.KingMoveStrategy
;
import
java.util.List
;
...
...
@@ -12,9 +11,8 @@ import java.util.List;
public
class
Pawn
extends
Piece
{
public
Pawn
(
Piece
.
Color
color
)
{
strength
=
0
;
representation
=
'k'
;
moveStrategy
=
new
KingMoveStrategy
();
strength
=
1
;
representation
=
'p'
;
this
.
color
=
color
;
}
...
...
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Queen.java
View file @
c47028e0
...
...
@@ -11,9 +11,9 @@ import com.example.paktalin.agilejava_exercises.moves.QueenMoveStrategy;
public
class
Queen
extends
Piece
{
public
Queen
(
Piece
.
Color
color
)
{
strength
=
0
;
representation
=
'
k
'
;
moveStrategy
=
new
King
MoveStrategy
();
strength
=
9
;
representation
=
'
q
'
;
moveStrategy
=
new
Queen
MoveStrategy
();
this
.
color
=
color
;
}
...
...
app/src/main/java/com/example/paktalin/agilejava_exercises/pieces/Rook.java
View file @
c47028e0
package
com
.
example
.
paktalin
.
agilejava_exercises
.
pieces
;
import
com.example.paktalin.agilejava_exercises.Position
;
import
com.example.paktalin.agilejava_exercises.moves.KingMoveStrategy
;
/**
* Created by Paktalin on 01/06/2018.
...
...
@@ -10,9 +9,8 @@ import com.example.paktalin.agilejava_exercises.moves.KingMoveStrategy;
public
class
Rook
extends
Piece
{
public
Rook
(
Piece
.
Color
color
)
{
strength
=
0
;
representation
=
'k'
;
moveStrategy
=
new
KingMoveStrategy
();
strength
=
5
;
representation
=
'r'
;
this
.
color
=
color
;
}
...
...
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