protected bool BlockIsEmpty(int x, int y, int z) { if (!BlockUtilities.IsWithinMapBounds(parentMap, x, y, z)) { return(false); } Block b = BlockUtilities.GetBlockAt(parentMap, x, y, z); if (b == null || (b.isNullBlock || b.actAsEmptyBlock)) { return(true); } return(false); }
protected bool CanMoveTo(int x, int y, int z) { if (!BlockUtilities.IsWithinMapBounds(parentMap, x, y, z)) { return(false); } if (!controller.CanMoveTo(x, y, z)) { return(false); } Block b = BlockUtilities.GetBlockAt(parentMap, x, y, z); if (b == null || b.isNullBlock || b.actAsEmptyBlock) { return(true); } return(false); }
public bool CanWalkTo(int x, int y, int z) { if (!BlockUtilities.IsWithinMapBounds(parentMap, x, y, z)) { //Debug.Log("Cannot walk to "+ x + "," + y + "," + z+": bounds"); return(false); } if (!controller.CanMoveTo(x, y, z)) { //Debug.Log("Cannot walk to "+ x + "," + y + "," + z+": controller"); return(false); } Block b = BlockUtilities.GetBlockAt(parentMap, x, y, z); if (b == null || b.isNullBlock || b.actAsEmptyBlock) { //Debug.Log("Can walk to "+ x + "," + y + "," + z+": not null"); return(true); } return(false); }