Add Prim/Kruskal maze gen & nodeData refactor
Implement Prim and Kruskal maze generation in the Labyrinth component with animated generation and UI guards. Introduces isAnimationRunning signal, mazeAnimationSpeed, maze node order tracking and animateMazeGeneration; createRandom(now takes a boolean) triggers either Prim or Kruskal flow, sets random start/end, and animates. Refactor Node.distance -> nodeData across models, components and the PathfindingService (Dijkstra/A*) to use nodeData for g-scores/ids. Add SharedFunctions.shuffleArray utility and update i18n (EN/DE) with labels for Prim/Kruskal. Misc: minor cleanup/init changes and drawing logic adjustments to support the new maze flows.
This commit is contained in:
@@ -364,6 +364,8 @@
|
||||
},
|
||||
"LABYRINTH": {
|
||||
"TITLE": "Labyrinth-Erzeugung",
|
||||
"PRIM": "Erzeuge Prim's Labyrinth",
|
||||
"KRUSKAL": "Erzeuge Kruskal's Labyrinth",
|
||||
"EXPLANATION": {
|
||||
"TITLE": "Algorithmen",
|
||||
"PRIM_EXPLANATION": "startet an einem zufälligen Punkt und erweitert das Labyrinth, indem er immer eine zufällige benachbarte Wand zu einer bereits besuchten Zelle auswählt und diese öffnet. Vorteil: Erzeugt sehr gleichmäßige, natürlich wirkende Labyrinthe mit vielen kurzen Sackgassen. Visuell wirkt es wie ein organisches Wachstum von einem Zentrum aus.",
|
||||
|
||||
Reference in New Issue
Block a user