fixed bug with collecting garbage
This commit is contained in:
parent
8244372044
commit
f5bc39f5ab
@ -35,8 +35,7 @@ class Garbage_collector(Cell):
|
|||||||
def collect_trash(self, house):
|
def collect_trash(self, house):
|
||||||
global GC_CAPACITY
|
global GC_CAPACITY
|
||||||
rubbish = house.get_rubbish_data()
|
rubbish = house.get_rubbish_data()
|
||||||
to_collect = [0,0,0]
|
to_collect = rubbish.copy()
|
||||||
to_collect = rubbish
|
|
||||||
|
|
||||||
dic = {
|
dic = {
|
||||||
0: "plastic",
|
0: "plastic",
|
||||||
@ -51,13 +50,13 @@ class Garbage_collector(Cell):
|
|||||||
self.trash_space_taken[dic[i]] += to_collect[i]
|
self.trash_space_taken[dic[i]] += to_collect[i]
|
||||||
self.trash_collected += to_collect[i]
|
self.trash_collected += to_collect[i]
|
||||||
print("GARBAGE COLLECTOR>> Took "+str(to_collect[i])+" "+dic[i])
|
print("GARBAGE COLLECTOR>> Took "+str(to_collect[i])+" "+dic[i])
|
||||||
|
|
||||||
house.give_away_rubbish(to_collect[0], to_collect[1], to_collect[2])
|
house.give_away_rubbish(to_collect[0], to_collect[1], to_collect[2])
|
||||||
|
|
||||||
def throw_trash(self, landfill):
|
def throw_trash(self, landfill):
|
||||||
landfill_type = landfill.get_type()
|
landfill_type = landfill.get_type()
|
||||||
print("GARBAGE COLLECTOR>> REMOVED "+landfill_type)
|
print("GARBAGE COLLECTOR>> REMOVED "+landfill_type)
|
||||||
self.trash_space_taken[landfill_type] = 0
|
self.trash_space_taken[landfill_type] = 0
|
||||||
|
|
||||||
def select_object(self, interactables):
|
def select_object(self, interactables):
|
||||||
print("### INTERACTION ###")
|
print("### INTERACTION ###")
|
||||||
|
Loading…
Reference in New Issue
Block a user