This module implements simulators.
Compile Options:
| Option | Description | Default |
|---|---|---|
| -d:pon2.path=<str> | Path of the web studio. | /pon2/stable/studio/ |
Types
SimulatorEditData = object selecting*: tuple[cellOpt: Opt[Cell], crossOpt: Opt[bool]] field*: tuple[row: Row, col: Col] steps*: tuple[index: int, pivot: bool, col: Col] focusField*: bool insert*: bool
- Edit information. Source Edit
SimulatorMode {.pure.} = enum PlayViewer, PlayEditor, EditViewer, EditEditor, Replay
- Simulator's mode. Source Edit
SimulatorState {.pure.} = enum Stable, WillPop, WillSettle, AfterEdit
- Simulator's state. Source Edit
Consts
EditorModes = {SimulatorMode.PlayEditor, SimulatorMode.EditEditor}
- Source Edit
ViewerModes = {SimulatorMode.PlayViewer, SimulatorMode.EditViewer}
- Source Edit
Procs
func editData(self: Simulator): SimulatorEditData {....raises: [], tags: [], forbids: [].}
- Returns the edit information of the simulator. Source Edit
func flipFieldHorizontal(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Flips the field horizontally. Source Edit
func flipFieldVertical(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Flips the field vertically. Source Edit
func goalClearColorOpt=(self: var Simulator; clearColorOpt: Opt[GoalColor]) {. ...raises: [], tags: [], forbids: [].}
- Sets the goal clear color. Source Edit
func goalColor=(self: var Simulator; color: GoalColor) {....raises: [], tags: [], forbids: [].}
- Sets the goal color. Source Edit
func goalKindOpt=(self: var Simulator; kindOpt: Opt[GoalKind]) {....raises: [], tags: [], forbids: [].}
- Sets the goal kind. Source Edit
func goalOperator=(self: var Simulator; operator: GoalOperator) {....raises: [], tags: [], forbids: [].}
- Sets the goal operator. Source Edit
func mark(self: Simulator): MarkResult {....raises: [], tags: [], forbids: [].}
- Marks the steps in the Nazo Puyo in the simulator. Source Edit
func mode(self: Simulator): SimulatorMode {....raises: [], tags: [], forbids: [].}
- Returns the mode of the simulator. Source Edit
func mode=(self: var Simulator; mode: SimulatorMode) {....raises: [], tags: [], forbids: [].}
- Sets the mode of the simulator. Source Edit
func moveCursorDown(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Moves the cursor downward. Source Edit
func moveCursorLeft(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Moves the cursor leftward. Source Edit
func moveCursorRight(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Moves the cursor rightward. Source Edit
func moveCursorUp(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Moves the cursor upward. Source Edit
func movePlacementLeft(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Moves the next placement left. Source Edit
func movePlacementRight(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Moves the next placement right. Source Edit
func moveResult(self: Simulator): MoveResult {....raises: [], tags: [], forbids: [].}
- Returns the moving result of the simulator. Source Edit
func normalizeGoal(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Normalizes the goal. This function does not affects undo/redo. Source Edit
func parseSimulator(uri: Uri): Pon2Result[Simulator] {....raises: [], tags: [], forbids: [].}
- Returns the simulator converted from the URI. Viewer modes are set to the result simulator preferentially if the FQDN is IshikawaPuyo or Ips. Source Edit
func rotatePlacementLeft(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Rotates the next placement left (counterclockwise). Source Edit
func rotatePlacementRight(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Rotates the next placement right (clockwise). Source Edit
func selectingCell=(self: var Simulator; cell: Cell) {....raises: [], tags: [], forbids: [].}
- Sets the selecting cell. Source Edit
func selectingCross=(self: var Simulator; cross: bool) {....raises: [], tags: [], forbids: [].}
- Sets the selecting cross. Source Edit
func shiftFieldDown(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Shifts the field downward. Source Edit
func shiftFieldLeft(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Shifts the field leftward. Source Edit
func shiftFieldRight(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Shifts the field rightward. Source Edit
func shiftFieldUp(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Shifts the field upward. Source Edit
func state(self: Simulator): SimulatorState {....raises: [], tags: [], forbids: [].}
- Returns the state of the simulator. Source Edit
func toExportUri(self: Simulator; viewer = true; clearPlacements = true; fqdn = Pon2): Pon2Result[Uri] {....raises: [], tags: [], forbids: [].}
- Returns the URI of the simulator with any moves reset. Source Edit
func toggleFocus(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Toggles focusing field or not. Source Edit
func toggleInsert(self: var Simulator) {....raises: [], tags: [], forbids: [].}
- Toggles inserting or not. Source Edit
func toUri(self: Simulator; clearPlacements = false; fqdn = Pon2): Pon2Result[ Uri] {....raises: [], tags: [], forbids: [].}
- Returns the URI converted from the simulator. Source Edit
func writeCell(self: var Simulator; cell: Cell) {....raises: [], tags: [], forbids: [].}
- Writes the cell to the selecting position in the field or steps. Source Edit
func writeCount(self: var Simulator; count: int) {....raises: [], tags: [], forbids: [].}
- Writes the nuisance count to the selecting position in the steps. Source Edit
func writeCount(self: var Simulator; index: int; col: Col; count: int) {. ...raises: [], tags: [], forbids: [].}
- Writes the nuisance count to the specified position in the steps. Source Edit
func writeCountClamp(self: var Simulator; index: int; col: Col; count: int) {. ...raises: [], tags: [], forbids: [].}
- Writes the nuisance clamped count to the specified position in the steps. Source Edit
func writeCross(self: var Simulator; cross: bool) {....raises: [], tags: [], forbids: [].}
- Writes the rotation to the selecting position in the steps. Source Edit
func writeCross(self: var Simulator; index: int) {....raises: [], tags: [], forbids: [].}
- Writes the selecting rotation to the specified position in the steps. Source Edit
Exports
-
puyoCount, $, cellCount, puyoCount, parsePlacement, moveLeft, DeadRule, score, puyoCount, del, rotatedLeft, $, init, cellCount, Field, puyoCount, nuisancePuyoCount, swapped, init, MoveResult, parseRule, mark, validDoublePlacements, coloredPuyoCount, pivotCol, init, ==, parseNazoPuyo, coloredPuyoCounts, init, parseStep, NuisancePuyos, Width, init, $, Rule, GoalOperator, Pair, toUriQuery, cellCount, isNormalized, $, movedLeft, GoalMain, rotateRight, AirHeight, puyoCount, MarkResult, connection2Vertical, colorsSeq, del, init, shiftRight, rotor, isValid, init, canPop, $, Steps, toUriQuery, ActualPlacements, Dir, init, cellCount, invalidPlacements, connection3, []=, shiftUp, puyoCount, NoneGoalColor, parseGoal, connection2Horizontal, init, rotatedRight, dropNuisance, placeCounts, toUriQuery, rotateLeft, SimulatorFqdn, nuisancePuyoCount, cellCount, init, init, parseSteps, nuisancePuyoCount, validPlacements, toUriQuery, DoublePlacements, movedRight, init, toUriQuery, parsePair, Notice, coloredPuyoCount, cellCount, nuisancePuyoCount, WaterTopRow, StepKind, init, cellCounts, Physics, isDouble, swap, WaterHeight, coloredPuyoCount, connection2, Col, Step, coloredPuyoCount, insert, toArray, parseSimulatorFqdn, init, parsePuyoPuyo, Cell, connectionCounts, rotorDir, init, Puyos, parseNazoPuyo, NoneGoalMain, parsePuyoPuyo, [], apply, puyoCount, nuisancePuyoCounts, ColoredPuyos, Behaviour, toField, noticeCounts, pivot=, Height, context, $, connection3LShape, isSupported, parseGoal, init, ==, isSettled, connectionCounts, PopResult, placeCounts, rotate, init, nuisancePuyoCount, toUriQuery, init, init, coloredPuyoCount, Row, isPopped, NoColorKinds, nuisancePuyoCount, init, init, parseStep, mpairs, connection3Horizontal, Placement, flipHorizontal, parseField, parsePair, isDead, puyoCounts, init, shiftDown, rotorCol, init, PuyoPuyo, init, flipVertical, pivot, Behaviours, shiftLeft, parseSteps, NazoPuyo, init, move, colors, parsePlacement, nuisancePuyoCount, toUriQuery, init, parseField, AirBottomRow, parseCell, cellCount, ColorKinds, normalized, place, insert, connectionCounts, GoalColor, Goal, Pon2Result, crossRotate, rotor=, init, connection3Vertical, noticeCounts, settle, toDeque, toUriQuery, coloredPuyoCount, moveRight, hardToGarbageCount, init, move, pop, NoneGoal, coloredPuyoCount, normalize, GoalKind