-
Notifications
You must be signed in to change notification settings - Fork 0
forwardCallbackResult
Space Expanse edited this page Apr 2, 2023
·
1 revision
The forwardCallbackResult method is where the main SpaceXpanse 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.
Use the sidebar in the right to navigate through the documentation
- Overview
- Step 0: Blockchain Basics
- Step 1: SpaceXpanse Daemon
- Step 2: The Game State Processor
- Step 3a: libspex Component Relationships
- Step 3b: Compile libspex in Windows
- Step 3b: Compile libspex in Ubuntu
- Step 4: Run SpaceXpanse Daemon for Games
- Step 5: Hello World! in C++
- Step 5: Hello World! in C#
- Step 5: Hello World! with SQLite
- Overview
- Tech Specs
- Blockchain Consensus Protocol
- Dual Algo Mining
- Currencies/Tokens
- Daemon Interface
- Games/dApps
- Atomic Trading
- How to Compile libspex in Ubuntu 20.04.03
- How to Compile libspex in Ubuntu 22.04
- How to Compile libspex in Windows
- libspex Component Relationships
- Getting Started with Regtest
- How to Wire Up libspex in C#
- RPC Windows C# Tutorial
- Atomic Transactions Tutorial
- Ships (How to get started playing)