Beispiel #1
0
        private Node NodeFactory(Position pos, string s)
        {
            s = s.ToUpper();
            switch (s)
            {
            case ".":
                return(new NeutralNode(pos, s));

            case "X":
                return(new WallNode(pos, s));

            case "G":
                _goal = new GoalNode(pos, s);
                return(_goal);

            case "S":
                _start = new StartNode(pos, "A");
                return(_start);

            default:
                throw new ArgumentException();
            }
        }
Beispiel #2
0
 public World(World w)
 {
     _start = w.Start;
     _goal  = w.Goal;
     _world = w.WorldNodes;
 }
Beispiel #3
0
 public World()
 {
     _start = null;
     _goal  = null;
 }