示例#1
0
 // Add a new step from {xorigin,yorigin} to {xdest,ydest}
 public void addStep(int xorigin, int yorigin, int xdest, int ydest)
 {
     if (currentIter < maxIter)
     {
         hexPath[currentIter] = map.getHexAt(xdest, ydest);
         addMovementCost(HexMapper.getMoveCost(map.getHexAt(xorigin, yorigin), map.getHexAt(xdest, ydest)));
         currentIter++;
         hexSteps++;
     }
 }
示例#2
0
文件: Hex.cs 项目: Syksy/HexEn3D
 // Obtain global coordinates if xglobal & yglobal have been set
 public xyz[] getGlobalVertices()
 {
     xyz[] xyzs = new xyz[7];
     if (xglobal != -1 & yglobal != -1)
     {
         // Global info available, mapping each vertex shifted by corresponding tile origo
         xyzs = HexMapper.createGlobalHexVertexCoord(xglobal, yglobal);
     }
     else
     {
         // No global info provided, using local coordinates instead as if located at {0,0} in tile map
         xyzs = this.getVertices();
     }
     return(xyzs);
 }
示例#3
0
文件: Hex.cs 项目: Syksy/HexEn3D
 public void setGlobalCoord(int x, int y)
 {
     this.xglobal  = x;
     this.yglobal  = y;
     this.vertices = HexMapper.createGlobalHexVertexCoord(x, y);
 }