Skip to content
Snippets Groups Projects
Commit 4f068991 authored by Florian Schröder's avatar Florian Schröder
Browse files

remove code in comments

parent 898ea8e0
No related branches found
No related tags found
1 merge request!19Resolve "Add recipe yaml check + visualize recipes"
Pipeline #43956 canceled
......@@ -134,31 +134,6 @@ class CookingEquipment(Item):
ingredients <= recipe["recipe"] for recipe in self.transitions.values()
)
"""
def can_combine(self, other):
if other is Non
# TODO remove when content ready and content list is implemented
if isinstance(self.content, Item):
return False
e:
return False
if self.content is None:
if isinstance(other, CookingEquipment):
return other.can_release_content()
# TODO check other is start of a meal, create meal
if isinstance(other, Meal) and "Plate" in self.name:
return not other.steps_needed or other.finished
return self.item_info.can_start_meal([other])
if self.content.can_combine(other):
return True
if isinstance(other, CookingEquipment) and other.content:
other = other.content
return self.item_info.can_start_meal(
[other]
+ ([self.content] if self.content.progressed_steps else self.content.parts)
)
"""
def combine(self, other):
return_value = None
if isinstance(other, CookingEquipment):
......@@ -187,43 +162,6 @@ e:
self.content_ready = None
return return_value
"""
def combine(self, other):
if self.content is None:
if isinstance(other, CookingEquipment):
self.content = other.release()
return other
if isinstance(other, Meal) and "Plate" in self.name:
self.content = other
return
# find starting meal for other
self.content = self.item_info.start_meal([other])
return
if not self.content.can_combine(other):
if isinstance(other, CookingEquipment) and other.content:
content = other.release()
self.content = self.item_info.start_meal(
[content]
+ (
[self.content]
if self.content.progressed_steps
else self.content.parts
)
)
return other
else:
self.content = self.item_info.start_meal(
[other]
+ (
[self.content]
if self.content.progressed_steps
else self.content.parts
)
)
return
self.content.combine(other)
"""
def can_progress(self) -> bool:
return self.active_transition is not None
......@@ -260,41 +198,6 @@ e:
self.active_transition = None
# class Meal(Item):
# def __init__(self, parts=None, *args, **kwargs):
# super().__init__(*args, **kwargs)
# self.parts = [] if parts is None else parts
# # self.rules ...
#
# def can_combine(self, other) -> bool:
# if other and not self.finished:
# satisfied = [False for _ in range(len(self.parts))]
# for n in self.item_info.needs:
# for i, p in enumerate(self.parts):
# if not satisfied[i] and p.name == n:
# satisfied[i] = True
# break
# else:
# if n == other.name:
# return True
# return False
#
# def combine(self, other):
# self.parts.append(other)
#
# def can_progress(self) -> bool:
# return self.item_info.steps_needed and len(self.item_info.needs) == len(
# self.parts
# )
#
# def finished_call(self):
# super().finished_call()
#
# @property
# def extra_repr(self):
# return self.parts
class Plate(CookingEquipment):
def __init__(self, transitions, clean, content=None, *args, **kwargs):
self.clean = clean
......@@ -309,17 +212,6 @@ class Plate(CookingEquipment):
def progress(self, equipment: str, percent: float):
Item.progress(self, equipment, percent)
# def progress(self, equipment: str, percent: float):
# """Progresses the item process as long as it is not finished."""
# if self.progressed_steps >= self.steps_needed:
# self.finished = True
# self.finished_call()
# if not self.finished:
# self.progressed_steps += 1
# def can_progress(self, counter_type="Sink") -> bool:
# return not self.clean
def create_name(self):
return "Plate" if self.clean else "DirtyPlate"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment