Exemple #1
0
        public CheckPathResult CheckPath(List <Vector2> path)
        {
            CheckPathResult result = new CheckPathResult();

            Alg.CheckPath(rule, board, path, out result.shape, out result.path, out result.neighbors);
            return(result);
        }
Exemple #2
0
        void TestBoardGame()
        {
            Board board = new Board();

            board.Pieces = new Piece[, ] {
                { new Piece(PieceShape.Circle), new Piece(PieceShape.Circle), new Piece(PieceShape.Rect) },
                { new Piece(PieceShape.Triangle), new Piece(PieceShape.Triangle), new Piece(PieceShape.Circle) },
                { new Piece(PieceShape.Circle), new Piece(PieceShape.Circle), new Piece(PieceShape.Circle) }
            };

            PieceShape     shape;
            List <Vector2> path;
            List <Vector2> neighbors;

            Alg.CheckPath(
                0,
                board,
                new Vector2[] {
                new Vector2(0, 0),
                new Vector2(0, 1),
                new Vector2(1, 1),
                new Vector2(1, 0),
                new Vector2(2, 0)
            }.ToList(),
                out shape,
                out path,
                out neighbors
                );

            print(shape);
            print("path");
            foreach (var pos in path)
            {
                print(pos);
            }

            print("neighbor");
            foreach (var pos in neighbors)
            {
                print(pos);
            }
        }