@Override public final boolean isCellBlocked(final int x, final int y) { if (!super.isCellBlocked(x, y)) { return false; } if (this.m_attachedBuilding.length != 0) { for (final AbstractBuildingStruct building : this.m_attachedBuilding) { if (building.contains(x, y) && building.isCellBlocked(x, y)) { return true; } } } return true; }
@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; }
@Override public final int getPathData( final int x, final int y, final CellPathData[] cellPathData, final int index) { assert this.checkGetPathData(x, y, cellPathData); int numZ = 1; final CellPathData data = cellPathData[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_cost = (byte) (super.isCellBlocked(x, y) ? -1 : 7); data.m_hollow = false; data.m_murfinInfo = (byte) this.getMurFinInfo(x, y); data.m_miscProperties = (byte) this.getMiscProperties(x, y); if (this.m_attachedBuilding.length != 0) { for (final AbstractBuildingStruct building : this.m_attachedBuilding) { final int result = building.getPathData(x, y, cellPathData, index + numZ); if (result != -1) { numZ += mergeSameAltitude(cellPathData, index, index + numZ, result); } } } return numZ; }