Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cooperative Cuisine Environment
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Commits
636263c2
Commit
636263c2
authored
1 year ago
by
Annika Österdiekhoff
Browse files
Options
Downloads
Patches
Plain Diff
current status, missing possibility to drop tomato on plate return
parent
085defd6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!8
Resolve "Can put tomatos on returned plate"
Pipeline
#41451
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
overcooked_simulator/counters.py
+29
-5
29 additions, 5 deletions
overcooked_simulator/counters.py
overcooked_simulator/game_items.py
+1
-1
1 addition, 1 deletion
overcooked_simulator/game_items.py
with
30 additions
and
6 deletions
overcooked_simulator/counters.py
+
29
−
5
View file @
636263c2
...
@@ -122,13 +122,37 @@ class PlateReturn(Counter):
...
@@ -122,13 +122,37 @@ class PlateReturn(Counter):
self
.
occupied_by
=
Plate
()
self
.
occupied_by
=
Plate
()
def
pick_up
(
self
):
def
pick_up
(
self
):
return
Plate
()
"""
Gets called upon a player performing the pickup action. Gives back a plate (possibly with ingredient.
def
drop_off
(
self
,
item
):
Returns: A plate possibly with an ingredient on it.
return
0
def
can_drop_off
(
self
,
item
):
"""
return
False
give_player
=
self
.
occupied_by
self
.
occupied_by
=
Plate
()
return
give_player
def
drop_off
(
self
,
item
:
HoldableItem
):
"""
Takes the ingredient dropped of by the player.
Args:
item: The ingredient to be placed on the counter.
"""
if
item
is
Plate
()
and
self
.
occupied_by
is
Plate
():
self
.
occupied_by
=
None
def
can_drop_off
(
self
,
item
:
HoldableItem
):
"""
Checks whether an ingredient by the player can be dropped of.
Args:
item: The ingredient for which to check, if it can be placed on the counter.
Returns: True if the ingredient can be placed on the counter, False if not.
"""
# possibility to drop off empty plate on empty plate return
return
(
isinstance
(
self
.
occupied_by
,
Plate
)
and
isinstance
(
item
,
Plate
)
)
or
self
.
occupied_by
.
can_combine
(
item
)
def
__repr__
(
self
):
def
__repr__
(
self
):
return
"
PlateReturn
"
return
"
PlateReturn
"
...
...
This diff is collapsed.
Click to expand it.
overcooked_simulator/game_items.py
+
1
−
1
View file @
636263c2
...
@@ -18,7 +18,7 @@ class Plate(HoldableItem):
...
@@ -18,7 +18,7 @@ class Plate(HoldableItem):
super
().
__init__
()
super
().
__init__
()
def
can_combine
(
self
,
other
:
HoldableItem
):
def
can_combine
(
self
,
other
:
HoldableItem
):
return
self
.
holds
is
None
return
self
.
holds
is
None
and
not
isinstance
(
other
,
Plate
)
def
combine
(
self
,
other
):
def
combine
(
self
,
other
):
self
.
holds
=
other
self
.
holds
=
other
...
...
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