Esempio n. 1
0
        public void follow_directional_path()
        {
            string input        = "R5, L5, R5, R3";
            var    pathFollower = new PathFollower();

            pathFollower.FollowPath(input, false);
            Assert.AreEqual(12, pathFollower.DistanceFromStart());
        }
Esempio n. 2
0
        public void follow_directional_path_without_repeat()
        {
            string input        = "R8, R4, R4, R8";
            var    pathFollower = new PathFollower();

            pathFollower.FollowPath(input, true);
            Assert.AreEqual(4, pathFollower.DistanceFromStart());
        }
Esempio n. 3
0
        private static void Main()
        {
            var pathFollower = new PathFollower();
            var path         = File.ReadAllText("input1.txt");

            pathFollower.FollowPath(path, true);
            Console.Write(pathFollower.DistanceFromStart());
            Console.ReadKey();
        }
Esempio n. 4
0
        public void FollowPath_GivenTestFile_ReturnsABCDEF()
        {
            string filename = @"Input\testa.txt";

            string expected = "ABCDEF";

            string actual = PathFollower.FollowPath(filename);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 5
0
    public void Update()
    {
        if (_stunned)
        {
            return;
        }

        if (_behaviour_pattern == BehaviourPattern.Path)
        {
            _path_follower.FollowPath();
        }
        else
        {
            _steerer.Act();
        }
    }