jer_test #1

Merged
s464943 merged 2 commits from jer_test into master 2022-04-14 23:29:46 +02:00
Showing only changes of commit 430cdc761e - Show all commits

View File

@ -1,32 +1,37 @@
from data import Direction
from data.CATEGORY import CATEGORY
from data.Item import Item
from data.Order import Order
from typing import Dict
class Game:
def __init__(self, id: int, agentPos: (int, int), deliveryPos: (int, int), orderPos: (int,int), stockPilePos: [(int,int)],
deliveryItem: Item, agentHandId: int, orderStock:[id], orderList: [Order] ):
def __init__(self, id: int, agentPos: (int, int), agentDirection: Direction, deliveryPos: (int, int), orderPos: (int,int), stockPilePos: Dict,
deliveryItem: Item, carriedItem: Item, orderStock: Dict, orderList: [Order]):
self.agentDirection = agentDirection
self.id = id
self.agentPos = agentPos
self.deliveryPos = deliveryPos
self.orderPos = orderPos
self.stockPilePos = stockPilePos
self.deliveryItem = deliveryItem
self.agentHandId = agentHandId
self.carriedItem = carriedItem
self.orderStock = orderStock
self.orderList = orderList
def move(self, x: int, y:int):
self.agentPos = (x, y)
def pickUp(self, item: Item):
self.deliveryItem = item
def drop(self, item: Item):
self.deliveryItem = -1
def identify(item: Item, category: CATEGORY):
item.category = category
def finishOrder(order: Order):
order.id = -1
def getCopy(self):
newGame = Game(self)
return newGame
# def move(self, x: int, y: int):
# self.agentPos = (x, y)
#
# def pickUp(self, item: Item):
# self.deliveryItem = item
#
# def drop(self, item: Item):
# self.deliveryItem = -1
#
# def identify(item: Item, category: CATEGORY):
# item.category = category
#
# def finishOrder(order: Order):
# order.id = -1