Ejemplo n.º 1
0
    // Gets the blockCode that is directly below
    public ushort GetBlockBelow()
    {
        if (coord.Equals(null))
        {
            return(0);
        }

        return(this.viewFieldBlocks[this.viewDistance.x * (this.viewDistance.y * 2 + 1) * (this.viewDistance.x * 2 + 1) + ((this.viewDistance.y - ((int)(this.hitbox.GetDiameter().y / 2) + 1))) * (this.viewDistance.x * 2 + 1) + this.viewDistance.x]);
    }
Ejemplo n.º 2
0
    /*
     * Function to gather the view area containing blocks and states that the mob will have the knowledge of
     */
    public byte RefreshView(CastCoord coord)
    {
        if (this.viewFieldBlocks == null)
        {
            return(0);
        }

        if (coord.Equals(null))
        {
            this.REFRESH_VISION = false;
            this.cl.GetField(coord, viewDistance, ref viewFieldBlocks, ref viewFieldStates);
            return(1);
        }

        if (!CastCoord.Eq(this.coord, coord) || this.REFRESH_VISION)
        {
            this.REFRESH_VISION = false;
            this.cl.GetField(coord, viewDistance, ref viewFieldBlocks, ref viewFieldStates);
            this.coord = coord;
            return(2);
        }

        return(0);
    }