-
Notifications
You must be signed in to change notification settings - Fork 10
forwardCallbackResult
Ryan edited this page Feb 11, 2019
·
1 revision
The forwardCallbackResult method is where the main XAYA game logic resides. Its signature is:
public static string forwardCallbackResult(string oldState,
string blockData,
string undoData,
out string newData)
oldState
is the current game state. It must be cast as a GameState
.
GameState state = JsonConvert.DeserializeObject<GameState>(oldState);
blockData
contains all the moves and should be deserialised.
dynamic blockDataS = JsonConvert.DeserializeObject(blockData);
undoData
is the undo data for the current game state. It needs to be updated so that the current set of moves can be rewound. For this, we create a new set of undo data for the current set of moves and store that in undoData
at the end of the method.
newData
is where the new game state is stored at the end of the method.
- Step 0: Blockchain Basics
- Step 1: xayad <⸺ start here
- Step 2: The Game State Processor
- Step 3a: libxayagame Component Relationships
- Step 3b: Compile libxayagame in Windows
- Step 3b: Compile libxayagame in Ubuntu
- Step 4: Run xayad for Games
- Step 5: Hello World! in C++
- Step 5: Hello World! in C#
- Step 5: Hello World! with SQLite
- Step 6a: Mover Overview
- Step 6b: Mover Console
- Step 6c: Mover Unity
- libxayagame Component Relationships
- How to Compile libxayagame in Ubuntu 20.04.03
- How to Compile libxayagame in Ubuntu 22.04
- How to Compile libxayagame in Windows
- Xayaships (How to get started playing)