예제 #1
0
        public void Test_1_SubTemplate_L6T2R()
        {
            var chain = new RailwayChain(Railway.L3, Railway.L3, Railway.T4R, Railway.T4R);

            var head = new Railway(RailwayType.L0);

            head.Append(chain);

            var destination = new Point(3, 9, -Math.PI / 2);

            var indexes = chain.FindSubTemplate(destination);

            Assert.IsNotNull(indexes);

            Assert.AreEqual(chain[0], indexes?.start);
            Assert.AreEqual(chain[3], indexes?.end);
        }
예제 #2
0
        public void Test_3_SubTemplate_L6T2L_Rotated()
        {
            var chain = new RailwayChain(Railway.L3, Railway.L3, Railway.T4L, Railway.T4L);

            var head = new Railway(RailwayType.L0);
            var last = head.Append(Railway.T4R);

            last = last.Append(Railway.T4R);
            last.Append(chain);

            var destination = new Point(-3, 9, Math.PI / 2);

            var indexes = chain.FindSubTemplate(destination);

            Assert.IsNotNull(indexes);

            Assert.AreEqual(chain[0], indexes?.start);
            Assert.AreEqual(chain[3], indexes?.end);
        }