Skip to content
Snippets Groups Projects
Commit 6eddf721 authored by Dahmane Lynda's avatar Dahmane Lynda
Browse files

Block.py

parent 4fdacb56
Branches
No related tags found
No related merge requests found
class Block:
def _init_(self,x:int,y,width:int,height:int,color=None):
self.x=x
self.y=y
self.width=width
self.height=height
self.sub_blocs=[]
def est_uniform(self)->bool:
if self.color is None:
return False
for sub_bloc in self.sub_blocs:
if sub_bloc.color!=self.color:
return False
return True
def ajouter_sub_bloc(self,bloc:str):
self.sub_blocs.append(bloc)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment