Sztuczna_Inteligencja/table.py
2019-06-05 00:09:16 +01:00

35 lines
1.3 KiB
Python

import pygame
class Table(object):
def __init__(self, x, y, game, height=2, width=4):
self.x = x
self.y = y
self.height = height
self.width = width
self.game = game
game.idTable += 1
game.idItem += 1
self.number = game.idItem
self.isWaiting = False
self.isClean = True
self.isOrdering = False
self.hasDish = False
self.id = game.idTable
self.image = pygame.image.load("./Images/stolik.png")
#self.image = pygame.transform.scale(self.image, (50, 50))
self.type = "table"
def draw(self):
self.table = pygame.Rect(self.x, self.y, 50, 50)
pygame.draw.rect(self.game.screen, (100, 0, 100), self.table)
if self.isOrdering:
self.game.screen.blit(pygame.image.load("./Images/stolikSkladaZamowienie.png"), (self.x, self.y))
elif self.isWaiting:
self.game.screen.blit(pygame.image.load("./Images/stolikOczekuje.png"), (self.x, self.y))
elif not self.isClean:
self.game.screen.blit(pygame.image.load("./Images/stolikBrudny.png"), (self.x, self.y))
elif self.hasDish:
self.game.screen.blit(pygame.image.load("./Images/stolikJedzenie.png"), (self.x, self.y))
else:
self.game.screen.blit((self.image), (self.x, self.y))