Beispiel #1
0
 public function getPieceFromArray()
 {
     if (!$this->piece) {
         return null;
     }
     return ['id' => $this->piece->getId(), 'type' => $this->piece->getType(), 'color' => $this->piece->getColor()];
 }
Beispiel #2
0
 /**
  * @param PieceInterface $piece
  *
  * @return string
  */
 public static function toAscii(PieceInterface $piece)
 {
     return self::$asciiPieces[$piece->getColor()][$piece->getType()];
 }
 /**
  * @param PieceInterface $piece
  *
  * @return array|null
  */
 private function getExpectedPieceArray(PieceInterface $piece = null)
 {
     if ($piece === null) {
         return null;
     }
     return ['id' => $piece->getId(), 'color' => $piece->getColor(), 'type' => $piece->getType()];
 }