Example #1
0
        public void MidpointInSetInv()
        {
            var connected = new List <Vector2Int>();
            var p1        = new Vector2Int(3, 3);
            var p2        = new Vector2Int(1, 1);

            Brensham.Connect(p1, p2, (x) => connected.Add(x));
            Assert.IsTrue(connected.Contains(new Vector2Int(2, 2)));
        }
Example #2
0
        public void NoOvershoot()
        {
            var connected = new List <Vector2Int>();
            var p1        = new Vector2Int(3, 3);
            var p2        = new Vector2Int(1, 1);

            Brensham.Connect(p1, p2, (x) => connected.Add(x));
            Assert.IsTrue(!connected.Contains(new Vector2Int(4, 4)));
        }
Example #3
0
        public void StartAndEndConnecteddy1()
        {
            var connected = new List <Vector2Int>();
            var p1        = new Vector2Int(3, 3);
            var p2        = new Vector2Int(3, 4);

            Brensham.Connect(p1, p2, (x) => connected.Add(x));
            Assert.IsTrue(connected.Contains(p1) && connected.Contains(p2));
        }