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
17ffb0e6
Commit
17ffb0e6
authored
7 years ago
by
zalavari
Browse files
Options
Downloads
Patches
Plain Diff
SwitchableHole looks like simplefield or hole, based on its state
parent
f1249c86
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/killer_sokoban/SwitchableHole.java
+6
-4
6 additions, 4 deletions
src/killer_sokoban/SwitchableHole.java
src/killer_sokoban/View.java
+1
-3
1 addition, 3 deletions
src/killer_sokoban/View.java
with
7 additions
and
7 deletions
src/killer_sokoban/SwitchableHole.java
+
6
−
4
View file @
17ffb0e6
...
@@ -20,8 +20,8 @@ public class SwitchableHole extends SimpleField {
...
@@ -20,8 +20,8 @@ public class SwitchableHole extends SimpleField {
ret
=
super
.
accept
(
toward
,
w
,
m
);
ret
=
super
.
accept
(
toward
,
w
,
m
);
}
}
//this seems like an else branch, but its not
//the hole could open while super.accept was being called
//the hole could open while super.accept was being called
//so it can't be an else branch
if
(
opened
)
if
(
opened
)
{
{
m
.
move
(
this
);
m
.
move
(
this
);
...
@@ -38,11 +38,9 @@ public class SwitchableHole extends SimpleField {
...
@@ -38,11 +38,9 @@ public class SwitchableHole extends SimpleField {
*/
*/
public
void
open
()
public
void
open
()
{
{
if
(
myMoveable
!=
null
)
if
(
myMoveable
!=
null
)
myMoveable
.
kill
();
myMoveable
.
kill
();
opened
=
true
;
opened
=
true
;
}
}
/**
/**
...
@@ -62,7 +60,11 @@ public class SwitchableHole extends SimpleField {
...
@@ -62,7 +60,11 @@ public class SwitchableHole extends SimpleField {
@Override
@Override
public
void
shouldDraw
(
View
view
)
public
void
shouldDraw
(
View
view
)
{
{
view
.
drawSwitchableHole
();
//Ha nyitva van, rajzolunk egy lyukat is
if
(
opened
)
view
.
drawHole
();
//Akár nyitva van, akár nem, kirajajzoljuk a többit is.
super
.
shouldDraw
(
view
);
super
.
shouldDraw
(
view
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/killer_sokoban/View.java
+
1
−
3
View file @
17ffb0e6
...
@@ -34,14 +34,12 @@ public class View {
...
@@ -34,14 +34,12 @@ public class View {
}
}
public
void
drawAbstract
()
{
public
void
drawAbstract
()
{
gc
.
setLineWidth
(
2
);
gc
.
setLineWidth
(
1
);
gc
.
setStroke
(
Color
.
BLUE
);
gc
.
setStroke
(
Color
.
BLUE
);
gc
.
strokeRect
(
x
*
tileSize
,
y
*
tileSize
,
tileSize
,
tileSize
);
gc
.
strokeRect
(
x
*
tileSize
,
y
*
tileSize
,
tileSize
,
tileSize
);
}
}
public
void
drawSimpleField
()
{
public
void
drawSimpleField
()
{
gc
.
setFill
(
Color
.
ALICEBLUE
);
//gc.fillRect(x*tileSize, y*tileSize, tileSize, tileSize);
}
}
public
void
drawTargetField
()
{
public
void
drawTargetField
()
{
...
...
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