Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
killer_sokoban
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
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
Schulcz Ferenc
killer_sokoban
Commits
e4cc863e
Commit
e4cc863e
authored
May 5, 2018
by
sfphoton
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix: crate will always know if it's on a TargetField or not
parent
6e3ee5f2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/killer_sokoban/Crate.java
+4
-1
4 additions, 1 deletion
src/killer_sokoban/Crate.java
with
4 additions
and
1 deletion
src/killer_sokoban/Crate.java
+
4
−
1
View file @
e4cc863e
...
@@ -4,6 +4,7 @@ package killer_sokoban;
...
@@ -4,6 +4,7 @@ package killer_sokoban;
public
class
Crate
extends
Moveable
{
public
class
Crate
extends
Moveable
{
private
boolean
isOnTarget
;
private
boolean
isOnTarget
;
private
int
onTargetTimes
=
0
;
/**
/**
...
@@ -19,6 +20,7 @@ public class Crate extends Moveable {
...
@@ -19,6 +20,7 @@ public class Crate extends Moveable {
*/
*/
public
void
stepOnTarget
(
Worker
w
)
{
public
void
stepOnTarget
(
Worker
w
)
{
w
.
incrementPoint
();
w
.
incrementPoint
();
onTargetTimes
++;
isOnTarget
=
true
;
isOnTarget
=
true
;
}
}
...
@@ -27,7 +29,8 @@ public class Crate extends Moveable {
...
@@ -27,7 +29,8 @@ public class Crate extends Moveable {
*/
*/
public
void
stepOffTarget
(
Worker
w
)
{
public
void
stepOffTarget
(
Worker
w
)
{
w
.
decrementPoint
();
w
.
decrementPoint
();
isOnTarget
=
false
;
onTargetTimes
--;
if
(
onTargetTimes
==
0
)
isOnTarget
=
false
;
}
}
/** Ha a láda kapcsolóra került, akkor kerül meghívásra ez a függvény.
/** Ha a láda kapcsolóra került, akkor kerül meghívásra ez a függvény.
...
...
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