private BaseObject GetNearestObjectByMat( Enums.GMaterials material )
    {
        if (visible_objs.size() == 0)
            return null;

        BaseObject obj = null;


        for (BaseObject element : visible_objs)
        {
            if (element != null && element.GetMatCountByType(material) > 0)
            {
                if (obj == null) obj = element;


                if (Math.abs(obj.GetCellX() - this.GetCellX()) + Math.abs(obj.GetCellY() - this.GetCellY())
                        > Math.abs(element.GetCellX() - this.GetCellX()) + Math.abs(element.GetCellY() - this.GetCellY()))
                    obj = element;
            }
        }


        return obj;
    }