Esempio n. 1
0
        public static (SG s1, SG s2, SG s3, SG s4, DN n1, DN n2) Flip(DN curr, DN pair, SG prv, V2 p_curr, V2 p_pair)
        {
            var alt = new SG(p_curr, p_pair);
            var na  = new DN(alt, prv.a);
            var nb  = new DN(alt, prv.b);

            na.neighbor.Add(nb);
            nb.neighbor.Add(na);
            var s1 = new SG(prv.a, p_curr);
            var s2 = new SG(prv.a, p_pair);
            var s3 = new SG(prv.b, p_curr);
            var s4 = new SG(prv.b, p_pair);

            na.SetNeighborWhenFlip(s1, curr);
            na.SetNeighborWhenFlip(s2, pair);
            nb.SetNeighborWhenFlip(s3, curr);
            nb.SetNeighborWhenFlip(s4, pair);
            return(s1, s2, s3, s4, na, nb);
        }