コード例 #1
0
 @Override
 public int getVisibilityData(
     final int x, final int y, final CellVisibilityData[] cellVisibilityData, final int index) {
   assert this.checkGetVisibilityData(x, y, cellVisibilityData);
   final CellVisibilityData data = cellVisibilityData[index];
   data.m_x = x;
   data.m_y = y;
   final int cellIndex = this.getIndex(x, y);
   data.m_z = this.m_zs[cellIndex];
   data.m_hollow = ((this.m_movLos[cellIndex] & 0x2) == 0x2);
   data.m_height = this.m_heights[cellIndex];
   return 1;
 }
コード例 #2
0
 @Override
 public int getVisibilityData(
     final int x, final int y, final CellVisibilityData[] cellVisibilityData, final int index) {
   assert this.checkGetVisibilityData(x, y, cellVisibilityData);
   int numZ = 1;
   final CellVisibilityData data = cellVisibilityData[index];
   data.m_x = x;
   data.m_y = y;
   data.m_z = this.getZ(x, y);
   data.m_height = (byte) Math.max(0, data.m_z);
   data.m_hollow = false;
   if (this.m_attachedBuilding.length != 0) {
     for (final AbstractBuildingStruct building : this.m_attachedBuilding) {
       final int result = building.getVisibilityData(x, y, cellVisibilityData, index + numZ);
       if (result != -1) {
         numZ += mergeSameAltitude(cellVisibilityData, index, index + numZ, result);
       }
     }
   }
   return numZ;
 }