Exemple #1
0
        bool CutNeighBors()
        {
            //No se puede eliminar un nodo conectado a un edificio
            if (North != null)
            {
                if (North.IsBuilding)
                {
                    return(false);
                }
            }
            if (South != null)
            {
                if (South.IsBuilding)
                {
                    return(false);
                }
            }
            if (West != null)
            {
                if (West.IsBuilding)
                {
                    return(false);
                }
            }
            if (East != null)
            {
                if (East.IsBuilding)
                {
                    return(false);
                }
            }

            if (North != null)
            {
                North.South = null;
                North.ChangeSprite();
                North = null;
            }

            if (South != null)
            {
                South.North = null;
                South.ChangeSprite();
                South = null;
            }

            if (East != null)
            {
                East.West = null;
                East.ChangeSprite();
                East = null;
            }

            if (West != null)
            {
                West.East = null;
                West.ChangeSprite();
                West = null;
            }

            return(true);
        }