Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gruppe 7 - Programmering 2 IDATT2001 - vår 2023
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Emil Leonard Aastrøm
Gruppe 7 - Programmering 2 IDATT2001 - vår 2023
Merge requests
!21
In game settings, undoMove and custom playerName/goals
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
In game settings, undoMove and custom playerName/goals
gameSettings
into
main
Overview
0
Commits
11
Pipelines
3
Changes
13
Merged
Emil Leonard Aastrøm
requested to merge
gameSettings
into
main
1 year ago
Overview
0
Commits
11
Pipelines
3
Changes
13
Expand
0
0
Merge request reports
Compare
main
version 2
c2a8b81b
1 year ago
version 1
881949da
1 year ago
main (base)
and
latest version
latest version
e9aa4b81
11 commits,
1 year ago
version 2
c2a8b81b
10 commits,
1 year ago
version 1
881949da
9 commits,
1 year ago
13 files
+
254
−
63
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
src/main/java/edu/ntnu/idatt2001/Controller/GameSelectionController.java
+
9
−
6
Options
@@ -2,24 +2,27 @@ package edu.ntnu.idatt2001.Controller;
import
edu.ntnu.idatt2001.Main
;
import
edu.ntnu.idatt2001.Model.FileHandler
;
import
edu.ntnu.idatt2001.Model.Goal.Goal
;
import
edu.ntnu.idatt2001.View.PathsView
;
import
javafx.stage.Stage
;
import
java.util.List
;
public
class
GameSelectionController
{
public
void
chooseGameFile
(
Stage
stage
){
public
void
chooseGameFile
(
Stage
stage
,
String
playerName
,
List
<
Goal
>
playerGoals
){
try
{
if
(
FileHandler
.
openGame
(
stage
))
{
PathsView
pathsView
=
new
PathsView
(
new
PathsController
(),
stage
);
if
(
FileHandler
.
openGame
(
stage
,
playerName
,
playerGoals
))
{
PathsView
pathsView
=
new
PathsView
(
new
PathsController
(
stage
),
stage
);
Main
.
changeScene
(
pathsView
.
getRoot
(),
stage
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
void
loadExampleFile
(
Stage
stage
,
String
path
){
FileHandler
.
openStaticGame
(
stage
,
path
);
PathsView
pathsView
=
new
PathsView
(
new
PathsController
(),
stage
);
public
void
loadExampleFile
(
Stage
stage
,
String
path
,
String
playerName
,
List
<
Goal
>
playerGoals
){
FileHandler
.
openStaticGame
(
stage
,
path
,
playerName
,
playerGoals
);
PathsView
pathsView
=
new
PathsView
(
new
PathsController
(
stage
),
stage
);
Main
.
changeScene
(
pathsView
.
getRoot
(),
stage
);
}
Loading