Puzzle animation utility class.
More...
#include <PuzzleAnimation.h>
|
| | PuzzleAnimation (std::vector< PuzzleState > const &transitions) |
| | Constructs an animated puzzle with numeric board. More...
|
| |
| | PuzzleAnimation (std::string const &img_path, std::vector< PuzzleState > const &transitions) |
| | Constructs an animated puzzle with an image board. More...
|
| |
| void | writeToFile (std::string fname) |
| | Writes the animation to an SVG file, you can open any modern browser, or use an SVG VSCode extension to view the SVG. More...
|
| |
Puzzle animation utility class.
◆ PuzzleAnimation() [1/2]
| PuzzleAnimation::PuzzleAnimation |
( |
std::vector< PuzzleState > const & |
transitions | ) |
|
|
inline |
Constructs an animated puzzle with numeric board.
- Parameters
-
| transitions | same as the results from solveAstar/solveBFS |
◆ PuzzleAnimation() [2/2]
| PuzzleAnimation::PuzzleAnimation |
( |
std::string const & |
img_path, |
|
|
std::vector< PuzzleState > const & |
transitions |
|
) |
| |
|
inline |
Constructs an animated puzzle with an image board.
- Parameters
-
| img_path | path the image used for animation |
| transitions | same as the results from solveAstar/solveBFS |
◆ writeToFile()
| void PuzzleAnimation::writeToFile |
( |
std::string |
fname | ) |
|
Writes the animation to an SVG file, you can open any modern browser, or use an SVG VSCode extension to view the SVG.
- Parameters
-
◆ height
| double PuzzleAnimation::height = 200 |
◆ stepDuration
| double PuzzleAnimation::stepDuration = 0.3 |
duration of each animation step in seconds
◆ tileSize
| double PuzzleAnimation::tileSize = std::min(width, height) / 4 |
◆ width
| double PuzzleAnimation::width = 200 |
The documentation for this class was generated from the following files: