Beispiel #1
0
    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);
    }
Beispiel #2
0
    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);
    }
Beispiel #3
0
    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);
    }