Пример #1
0
 function calculateHexpartName()
 {
     //	var name;
     // center = 1, lower = 2, lower left = 3, upper left = 4
     switch ($this->hexpartType) {
         case 1:
             $this->refHexpartX = $this->x;
             $this->refHexpartY = $this->y;
             $this->prefix = "hexpart:";
             break;
         case 2:
             $this->refHexpartX = $this->x;
             $this->refHexpartY = $this->y - 2;
             $this->prefix = "hexpart_";
             break;
         case 3:
             $this->refHexpartX = $this->x + 1;
             $this->refHexpartY = $this->y - 1;
             $this->prefix = "hexpart\\";
             break;
         case 4:
             $this->refHexpartX = $this->x + 1;
             $this->refHexpartY = $this->y + 1;
             $this->prefix = "hexpart/";
             break;
     }
     if ($this->hexpartType > 0) {
         $refHexagon = new Hexagon();
         $refHexagon->setXY($this->refHexpartX, $this->refHexpartY);
         $this->name = $this->prefix + $refHexagon->getName();
     } else {
         $this->hexpartName = "null";
     }
 }