From 6eddf721483a81917264ed89f3172dae7fbc5ed4 Mon Sep 17 00:00:00 2001 From: Dahmane Lynda <lynda.dahmane.etu@a10p29.fil.univ-lille.fr> Date: Thu, 28 Mar 2024 11:57:06 +0100 Subject: [PATCH] Block.py --- projet/Block.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 projet/Block.py diff --git a/projet/Block.py b/projet/Block.py new file mode 100644 index 0000000..287684d --- /dev/null +++ b/projet/Block.py @@ -0,0 +1,36 @@ + + +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 -- GitLab