WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. API
  4. PawnLibs/scramble
Mission NodeSDK 6.3PawnAPI Reference

PawnLibs/scramble

PawnLibs/scramble Summary A helper library that facilitates level initialization. Description This library contains several useful utilities which simulate c...

API / SDK 6.3 / Pawn / API Reference

PawnLibs/scramble

Summary

A helper library that facilitates level initialization.

Description

This library contains several useful utilities which simulate cube twists. An application can initialize its inner state data with wining condition and do some virtual twists to prepare initial arrangement for player like deck shuffling or Rubik'c cube scramble.

To use this library several functions have to be defined:

  • RememberDataBeforeTwist()
  • SetDataAfterTwist(moduleTo, screenTo, moduleFrom, screenFrom)
  • VirtualTwist(twist[TOPOLOGY_TWIST_INFO])

TBD - add detailed descriptions of required functions

Example

TBD - add example description

PawnLibs/scramble
PAWN
1 new mapping[MODULES_MAX][SCREENS_MAX];
2 new mappingTemp[MODULES_MAX][SCREENS_MAX];
3
4 RememberDataBeforeTwist() {
5 // Back up current mapping
6 mappingTemp = mapping;
7 }
8
9 SetDataAfterTwist(moduleTo, screenTo, moduleFrom, screenFrom) {
10 // Fill mapping according to the new topology after twise
11 mapping[moduleTo][screenTo] = mappingTemp[moduleFrom][screenFrom];
12 }
13
14 VirtualTwist(twist[TOPOLOGY_TWIST_INFO]) {
15 // Additional handling of virtual twist if necessary
16 myTwist = twist;
17 }
18
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/scramble/Scramble

Summary

Scramble the cube randomly the specified number of times.

Synopsis

PawnLibs/scramble
PAWN
1Scramble(twistsCount)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Inputs

  • twistsCount - how many times to twist the cube for scramble

PawnLibs/scramble/ScrambleRotate

Summary

Twist the cube around some screen in a specified direction.

Synopsis

PawnLibs/scramble
PAWN
1ScrambleRotate(scr, dir)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Inputs

  • scr - a screen to twist around
  • dir - a direction of the twist

Jump Grid

On This Page

PawnLibs/scramble/ScramblePawnLibs/scramble/ScrambleRotate
Context Rail

Related nodes

PawnLibs/wowcore/SELF\ ID
API / SDK 6.3 / Pawn / API Reference
PawnLibs/graphics
API / SDK 6.3 / Pawn / API Reference
PawnLibs/sound/SND\ cacheSounds
API / SDK 6.3 / Pawn / API Reference
PawnLibs/topology
API / SDK 6.3 / Pawn / API Reference
Previous Node
PawnLibs/log
API / SDK 6.3 / Pawn / API Reference
Next Node
PawnLibs/network
API / SDK 6.3 / Pawn / API Reference