Пример #1
0
 private function tileToHTML(Tile $tile, array $screenCoords, Coordinates $coordinates)
 {
     $classTile = 'clear';
     $label = '';
     if (!$tile->isClear()) {
         $classTile = 'occupied';
     }
     if ($tile->hasGoalPathMarker()) {
         $classTile = 'goalPath';
     }
     if ($tile->hasStartMarker()) {
         $classTile = 'start';
         $label = 'start';
     }
     if ($tile->hasGoalMarker()) {
         $classTile = 'goal';
         $label = 'goal';
     }
     return '<div class="tile ' . $classTile . '" style="left:' . $screenCoords[0] . 'px; top:' . $screenCoords[1] . 'px; width:' . $this->tile_size . 'px; height:' . $this->tile_size . 'px;" title="' . $coordinates->__toString() . '">' . $label . '</div>';
 }