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
610fe015
Commit
610fe015
authored
7 years ago
by
zalavari
Browse files
Options
Downloads
Patches
Plain Diff
No longer asks the user, whether the hole's open or not (it knows by
itself)
parent
5874e14c
No related branches found
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/SwitchableHole.java
+2
-34
2 additions, 34 deletions
src/killer_sokoban/SwitchableHole.java
with
2 additions
and
34 deletions
src/killer_sokoban/SwitchableHole.java
+
2
−
34
View file @
610fe015
package
killer_sokoban
;
import
java.util.Scanner
;
import
java.util.ArrayList
;
public
class
SwitchableHole
extends
SimpleField
{
boolean
opened
=
tru
e
;
boolean
opened
=
fals
e
;
/**Ez a függvény azt jelzi a mező számára, hogy szeretnének rálépni.
* @param toward melyik irányból szeretnének rálépni
...
...
@@ -18,31 +13,10 @@ public class SwitchableHole extends SimpleField {
@Override
public
boolean
accept
(
Direction
toward
,
Worker
w
,
Moveable
m
)
{
System
.
out
.
println
(
"Nyitva van a lyuk? (I/N)"
);
Scanner
sc
=
new
Scanner
(
System
.
in
);
String
valasz
=
sc
.
next
();
if
(
valasz
.
equals
(
"I"
)||
valasz
.
equals
(
"i"
))
{
open
();
}
else
if
(
valasz
.
equals
(
"N"
)||
valasz
.
equals
(
"n"
))
{
close
();
}
else
{
System
.
out
.
println
(
"Hülyeséget válaszoltál, nem vállalom a felelősséget!"
);
}
boolean
ret
=
true
;
if
(!
opened
)
{
ret
=
super
.
accept
(
toward
,
w
,
m
);
}
...
...
@@ -53,11 +27,9 @@ public class SwitchableHole extends SimpleField {
m
.
move
(
this
);
m
.
kill
();
ret
=
true
;
}
return
ret
;
}
...
...
@@ -78,17 +50,13 @@ public class SwitchableHole extends SimpleField {
*/
public
void
close
()
{
opened
=
false
;
}
public
void
printStat
()
{
super
.
printStat
();
System
.
out
.
println
(
"opened: "
+
opened
);
}
}
...
...
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