Exemple #1
0
 public function __construct($arg)
 {
     if (is_int($arg)) {
         // Créer un nouveau pion à partir du slot_position
         $this->id = Pion::$id_count++;
         $this->slot_position = $arg;
     } else {
         // Constructeur par copie
         $this->id = $arg->id;
         $this->slot_position = $arg->slot_position;
         $this->est_promu = $arg->est_promu;
         $this->coords = Coords::createFrom($arg->coords);
     }
 }