Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SpaceCheckers
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
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
TDT4240-group23
SpaceCheckers
Merge requests
!9
GameStateClass
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
GameStateClass
gamestate
into
default-game
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Nikolai Mork
requested to merge
gamestate
into
default-game
4 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
default-game
default-game (base)
and
latest version
latest version
4a1903f3
1 commit,
4 years ago
1 file
+
54
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
CheckersClient/core/src/com/mygdx/game/model/GameState.kt
+
54
−
2
Options
//Holds the state of the game, where pieces are, where powerups are, is it finished etc.
//Data of game
\ No newline at end of file
package
com.mygdx.game.model
/*
Holds the state of the game and all data related to this.
*/
class
GameState
(
board
:
AbstractBoard
,
rules
:
AbstractRules
)
{
private
var
boardState
:
AbstractBoard
private
var
rules
:
AbstractRules
private
var
isStarted
:
Boolean
private
var
winner
:
Player
?
init
{
this
.
rules
=
rules
this
.
boardState
=
board
this
.
isStarted
=
false
this
.
winner
=
null
}
fun
setBoardState
(
boardState
:
AbstractBoard
)
{
this
.
boardState
=
boardState
}
fun
getBoradState
():
AbstractBoard
{
return
boardState
}
fun
getRules
():
AbstractRules
{
return
rules
}
fun
isStarted
():
Boolean
{
return
isStarted
}
fun
setStarted
()
{
this
.
isStarted
=
true
}
fun
isFinished
():
Boolean
{
if
(
this
.
winner
!=
null
)
{
return
true
}
return
false
}
fun
getWinner
():
Player
?
{
return
this
.
winner
}
fun
setWinner
(
winner
:
Player
)
{
this
.
winner
=
winner
}
}
\ No newline at end of file
Loading