Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Input szoftver projekt laboratorium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
aaendru
Input szoftver projekt laboratorium
Commits
8aa67ea5
Commit
8aa67ea5
authored
5 years ago
by
CsellarAndras
Browse files
Options
Downloads
Patches
Plain Diff
Correction in Person
parent
0bde27c0
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
Arctic_Nigthmare/src/arctic_nightmare/Person.java
+5
-19
5 additions, 19 deletions
Arctic_Nigthmare/src/arctic_nightmare/Person.java
with
5 additions
and
19 deletions
Arctic_Nigthmare/src/arctic_nightmare/Person.java
+
5
−
19
View file @
8aa67ea5
...
...
@@ -34,7 +34,7 @@ public abstract class Person {
{
items
=
new
Vector
<>();
this
.
field
=
field
;
field
.
a
ddPerson
(
this
);
field
.
a
ccept
(
this
);
this
.
name
=
name
;
work
=
4
;
id
=
idcounter
++;
...
...
@@ -95,7 +95,7 @@ public abstract class Person {
Logger
.
LogAndIncreaseTabs
(
"Person("
+
name
+
") fall"
);
//teszthez
if
(
items
.
contains
(
new
Item
(
"DivingSuit"
)))
{
Logger
.
Log
(
">>"
+
this
.
getName
()
+
"-nek van búvárruhája, túléli"
,
false
);
step
(
Direction
.
RIGHT
);
step
(
field
.
getNeighbors
().
get
(
0
)
);
}
else
{
Logger
.
Log
(
">>"
+
this
.
getName
()
+
"-nek nincs búvárruhája, segítők keresése"
,
false
);
...
...
@@ -144,8 +144,8 @@ public abstract class Person {
Logger
.
LogAndIncreaseTabs
(
"Person("
+
name
+
") findHelpers"
);
ArrayList
<
Person
>
potentialhelpers
=
new
ArrayList
<
Person
>();
Direction
dirs
[]
=
Direction
.
values
();
for
(
Direction
dir:
dirs
)
{
//iteralas az osszes iranyt tartalmazo tombon
Field
neighbor
=
field
.
getNeighbor
(
dir
);
//elkerjuk a sajat fieldtol az adott iranyban levo szomszedot
List
<
Field
>
neighbors
=
field
.
getNeighbors
();
for
(
Field
neighbor
:
neighbors
)
{
//iteralas az osszes iranyt tartalmazo tombon
potentialhelpers
.
addAll
(
neighbor
.
getPersons
());
}
Logger
.
decreaseTabs
();
...
...
@@ -204,20 +204,6 @@ public abstract class Person {
Logger
.
decreaseTabs
();
// ha van asoja, akkor 2 reteg havat tud letakaritani ha nincs akkor 1-t
}
public
void
step
(
Direction
direction
)
{
Logger
.
LogAndIncreaseTabs
(
"Person("
+
name
+
") step("
+
direction
+
")"
);
Field
neighbor
=
field
.
getNeighbor
(
direction
);
if
(
neighbor
!=
null
)
{
field
.
remove
(
this
);
field
=
neighbor
;
neighbor
.
accept
(
this
);
work
--;
}
Logger
.
decreaseTabs
();
}
public
void
step
(
Field
field
)
{
...
...
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