Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Doppeltgemoppelt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
btomi96
Doppeltgemoppelt
Commits
3e14a5d6
Commit
3e14a5d6
authored
May 15, 2016
by
edani95
Browse files
Options
Downloads
Patches
Plain Diff
Map sequence bug fix
parent
65092334
Branches
Branches containing commit
No related tags found
1 merge request
!60
Graphcontroller
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/app/Controller.java
+1
-0
1 addition, 0 deletions
core/app/Controller.java
core/app/GameController.java
+2
-3
2 additions, 3 deletions
core/app/GameController.java
core/game/Model.java
+9
-0
9 additions, 0 deletions
core/game/Model.java
with
12 additions
and
3 deletions
core/app/Controller.java
+
1
−
0
View file @
3e14a5d6
...
...
@@ -157,6 +157,7 @@ public class Controller {
*/
private
boolean
initMap
(
String
mapPath
)
throws
IOException
{
Model
.
getInstance
().
restartMap
();
BufferedReader
br
=
new
BufferedReader
(
new
FileReader
(
mapPath
));
String
command
;
...
...
This diff is collapsed.
Click to expand it.
core/app/GameController.java
+
2
−
3
View file @
3e14a5d6
...
...
@@ -39,8 +39,6 @@ public class GameController implements PropertyChangeListener{
*/
public
void
startGameProcess
(
int
[]
rZPMCount
)
throws
GameRunningException
{
Model
.
getInstance
().
restartMap
();
int
failure
=
0
;
int
counter
=
0
;
...
...
@@ -217,7 +215,7 @@ public class GameController implements PropertyChangeListener{
}
// end of while
Model
.
getInstance
().
removePropertyChangeListener
(
this
);
return
;
// Map finished
}
...
...
@@ -316,6 +314,7 @@ public class GameController implements PropertyChangeListener{
// update only the changed fields
int
coord
=
(
int
)
evt
.
getNewValue
();
System
.
out
.
println
(
coord
);
int
xCoord
=
coord
/
map
[
0
].
length
;
int
yCoord
=
coord
%
map
[
0
].
length
;
Field
changedField
=
(
Field
)
evt
.
getOldValue
();
...
...
This diff is collapsed.
Click to expand it.
core/game/Model.java
+
9
−
0
View file @
3e14a5d6
...
...
@@ -51,6 +51,14 @@ public class Model implements PropertyChangeListener
}
}
public
void
removePropertyChangeListener
(
PropertyChangeListener
listener
)
{
if
(
listener
!=
null
)
{
propSupp
.
removePropertyChangeListener
(
listener
);
}
}
public
void
setColonel
(
Player
colonel
)
{
this
.
colonel
=
colonel
;
...
...
@@ -94,6 +102,7 @@ public class Model implements PropertyChangeListener
public
void
restartMap
()
{
map
=
new
ArrayList
<>();
isMapFinished
=
false
;
}
...
...
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