feat: implement stack
This commit is contained in:
@@ -13,7 +13,7 @@ class Entity:
|
||||
pass
|
||||
|
||||
def draw(self, surface: pygame.Surface) -> None:
|
||||
tile_size = ConfigurationManager.configuration["engine"]["tile-size"]
|
||||
tile_size = ConfigurationManager.configuration["engine"]["tile-size"]
|
||||
|
||||
for square in self.points:
|
||||
pygame.draw.polygon(surface, pygame.Color(self.color), square, 0)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from typing import List, Tuple
|
||||
import pygame
|
||||
import copy
|
||||
|
||||
from entity.Entity import Entity
|
||||
|
||||
10
entity/Stack.py
Normal file
10
entity/Stack.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from entity.Piece import Piece
|
||||
from entity.Entity import Entity
|
||||
|
||||
class Stack(Entity):
|
||||
|
||||
def __init__(self, color: str, border_color: str):
|
||||
super().__init__([], color, border_color)
|
||||
|
||||
def add_piece(self, piece: Piece):
|
||||
self.points += piece.points
|
||||
@@ -1,5 +1,4 @@
|
||||
from typing import List, Tuple
|
||||
import pygame
|
||||
|
||||
from entity.Entity import Entity
|
||||
from util.ConfigurationManager import ConfigurationManager
|
||||
|
||||
Reference in New Issue
Block a user