Exemple #1
0
    public void updateWindowsFlushWithEdgeInNeighborDirection(byte[] surfaceHeightsAtEdge, NeighborDirection ndir)
    {
        // ndir is neighb's relation to us
        // so want the windows on the opposite edge
        Direction dir  = NeighborDirectionUtils.DirecionFourForNeighborDirection(NeighborDirectionUtils.oppositeNeighborDirection(ndir));
        Axis      axis = DirectionUtil.AxisForDirection(dir);

        if (axis == Axis.X)
        {
            updateWindowsAlongXEdge(surfaceHeightsAtEdge, DirectionUtil.IsPosDirection(dir));
            return;
        }

        updateWindowsAlongZEdge(surfaceHeightsAtEdge, DirectionUtil.IsPosDirection(dir));
    }
Exemple #2
0
    /*
     * Z introductions
     *
     * */
    private void introduceFlushWithWindowMapInNeighborDirectionZ(WindowMap other, NeighborDirection ndir)
    {
        Direction dir    = NeighborDirectionUtils.DirecionFourForNeighborDirection(ndir);
        Direction oppDir = NeighborDirectionUtils.DirecionFourForNeighborDirection(NeighborDirectionUtils.oppositeNeighborDirection(ndir));

        //want windows flush with a given z value (0 or max)
        List <Window>[] thisWinListArrayAtEdge      = this.windowsTouchingEdgeOfNoisePatchNeighborInDirection(dir);
        List <Window>[] winListArrayAtAnEdgeOfOther = other.windowsTouchingEdgeOfNoisePatchNeighborInDirection(oppDir);

        AssertUtil.Assert(thisWinListArrayAtEdge.Length == winListArrayAtAnEdgeOfOther.Length, "confusing. and not what we expected. lists should be the same length");

        bool wantExtentForThis = DirectionUtil.IsPosDirection(dir);

//		this.testSetAllMaxLight(); //TEST
//		other.testSetAllMaxLight();
//
//		return;

        for (int i = 0; i < thisWinListArrayAtEdge.Length; ++i)
        {
            List <Window> wins = thisWinListArrayAtEdge[i];
            foreach (Window win in wins)
            {
                //TEST
//				win.testSetMaxLight(null);
                win.updateWithWindowsFlushWithAnEdge(winListArrayAtAnEdgeOfOther[i], wantExtentForThis);
            }
        }

        for (int i = 0; i < winListArrayAtAnEdgeOfOther.Length; ++i)
        {
            List <Window> wins = winListArrayAtAnEdgeOfOther[i];
            foreach (Window win in wins)
            {
                //TEST
//				win.testSetMaxLight(null);
                win.updateWithWindowsFlushWithAnEdge(thisWinListArrayAtEdge[i], !wantExtentForThis);
            }
        }
    }
Exemple #3
0
    /*
     * X AXIS NEIGHBOR INTRODUCTIONS
     *
     */
    private void introduceFlushWithWindowMapInNeighborDirectionX(WindowMap other, NeighborDirection ndir)
    {
        return;         // !!!!

        Direction dir    = NeighborDirectionUtils.DirecionFourForNeighborDirection(ndir);
        Direction oppDir = NeighborDirectionUtils.DirecionFourForNeighborDirection(NeighborDirectionUtils.oppositeNeighborDirection(ndir));

        //want windows along a z on a given x val (0 or max)
        List <Window>[] thisWinListArrayAtEdge      = this.windowsTouchingEdgeOfNoisePatchNeighborInDirection(dir);
        List <Window>[] winListArrayAtAnEdgeOfOther = other.windowsTouchingEdgeOfNoisePatchNeighborInDirection(oppDir);

        if (thisWinListArrayAtEdge.Length == 0 || winListArrayAtAnEdgeOfOther.Length == 0)
        {
            AssertUtil.Assert(false, "??? 0 length arrays");
            return;
        }

        AssertUtil.Assert(thisWinListArrayAtEdge.Length == 1 && winListArrayAtAnEdgeOfOther.Length == 1, "Confusing. dealing with x edge right? length was: " + thisWinListArrayAtEdge.Length);

        foreach (Window win in thisWinListArrayAtEdge[0])        // when world was flat this was null!
        {
//			win.testSetAllValuesTo(4f);
            //TEST
            win.setMaxLight();
//			win.updateWithAdjacentWindowsReturnAddedLightRating(winListArrayAtAnEdgeOfOther[0]);
        }


        foreach (Window othersWin in winListArrayAtAnEdgeOfOther[0])
        {
//			othersWin.testSetAllValuesTo(4f);
            othersWin.setMaxLight();             //TEST

//			othersWin.updateWithAdjacentWindowsReturnAddedLightRating(thisWinListArrayAtEdge[0]);
        }
    }