|
|
@@ -1766,6 +1766,7 @@ class Plateau(QGraphicsScene):
|
|
|
|
|
|
def pionClique(self, num):
|
|
|
"""on a clique sur ce pion"""
|
|
|
+ accepte = False
|
|
|
if num < 10000:
|
|
|
self.modeActif.clic_combattant(num)
|
|
|
|
|
|
@@ -1807,15 +1808,20 @@ class Plateau(QGraphicsScene):
|
|
|
accepte = True
|
|
|
return accepte
|
|
|
|
|
|
- def creerPion(self, pion):
|
|
|
+ def creerPion(self, pionModele):
|
|
|
"""creer un pion (combattant ou decor) aux coordonnees indiquees"""
|
|
|
cree = False
|
|
|
if self.proj.projectionValide():
|
|
|
- pion.position = self.proj.coord()
|
|
|
- pion.nbRotations = self.proj.nbRotations()
|
|
|
- pion.ajouterAuPlateau(self)
|
|
|
|
|
|
- if pion.__class__.__name__ == "Combattant":
|
|
|
+ if pionModele.__class__.__name__ == "Combattant":
|
|
|
+ pion = Combattant()
|
|
|
+ elif pionModele.__class__.__name__ == "Decor":
|
|
|
+ pion = Decor()
|
|
|
+
|
|
|
+ for elt in pionModele.__dict__:
|
|
|
+ pion.__dict__[elt] = pionModele.__dict__[elt]
|
|
|
+
|
|
|
+ if pionModele.__class__.__name__ == "Combattant":
|
|
|
numero = 1
|
|
|
if len(self.combattants) > 0:
|
|
|
numero = max(self.combattants) + 1
|
|
|
@@ -1823,13 +1829,17 @@ class Plateau(QGraphicsScene):
|
|
|
pion.numComplementaire = self.numeroterNom(pion.nom)
|
|
|
self.combattants[numero] = pion
|
|
|
self.pionDeplacerDansOrdreJeu(numero, len(self.ordreJeu) + 2)
|
|
|
- elif pion.__class__.__name__ == "Decor":
|
|
|
+ elif pionModele.__class__.__name__ == "Decor":
|
|
|
numero = 10001
|
|
|
if len(self.decors) > 0:
|
|
|
numero = max(self.decors) + 10001
|
|
|
pion.numero = numero
|
|
|
self.decors[numero] = pion
|
|
|
-
|
|
|
+
|
|
|
+ pion.position = self.proj.coord()
|
|
|
+ pion.nbRotations = self.proj.nbRotations()
|
|
|
+ pion.ajouterAuPlateau(self)
|
|
|
+
|
|
|
cree = True
|
|
|
return cree
|
|
|
|