Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tick-Tack-Trauma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Josua Oppermann
Tick-Tack-Trauma
Commits
ae53b68b
Commit
ae53b68b
authored
2 months ago
by
JimmyTheCat
Browse files
Options
Downloads
Patches
Plain Diff
player flip by reset, board class mechanic and board constructor cleanup
parent
3b4e499d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Board.java
+15
-6
15 additions, 6 deletions
Board.java
with
15 additions
and
6 deletions
Board.java
+
15
−
6
View file @
ae53b68b
...
@@ -13,6 +13,11 @@ public class Board extends Thread {
...
@@ -13,6 +13,11 @@ public class Board extends Thread {
*/
*/
Player
players
[]
=
new
Player
[
2
];
Player
players
[]
=
new
Player
[
2
];
/**This Integer defines which character gets to draw first.
*
*/
int
firstPlayer
;
/**This Integer defines which character can currently draw on a tile.
/**This Integer defines which character can currently draw on a tile.
*
*
*/
*/
...
@@ -27,16 +32,20 @@ public class Board extends Thread {
...
@@ -27,16 +32,20 @@ public class Board extends Thread {
* Creates the Tiles and Players and sets the player who starts the game.
* Creates the Tiles and Players and sets the player who starts the game.
*/
*/
Board
()
{
Board
()
{
for
(
int
i
=
0
;
i
<
tiles
.
length
;
i
++)
tiles
[
i
]
=
new
Tile
(
0
,
0
,
0
);
for
(
int
i
=
0
;
i
<
players
.
length
;
i
++)
players
[
i
]
=
new
Player
(
i
+
1
);
for
(
int
i
=
0
;
i
<
players
.
length
;
i
++)
players
[
i
]
=
new
Player
(
i
+
1
);
curren
tPlayer
=
0
;
firs
tPlayer
=
0
;
marks
=
0
;
initBoard
()
;
}
}
Board
(
Player
[]
players
)
{
Board
(
Player
[]
players
,
int
firstPlayer
)
{
for
(
int
i
=
0
;
i
<
tiles
.
length
;
i
++)
tiles
[
i
]
=
new
Tile
(
0
,
0
,
0
);
this
.
players
=
players
;
this
.
players
=
players
;
currentPlayer
=
0
;
this
.
firstPlayer
=
firstPlayer
==
1
?
0
:
1
;
initBoard
();
}
private
void
initBoard
()
{
for
(
int
i
=
0
;
i
<
tiles
.
length
;
i
++)
tiles
[
i
]
=
new
Tile
(
0
,
0
,
0
);
currentPlayer
=
firstPlayer
;
marks
=
0
;
marks
=
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment