inkcpp
Toggle main menu visibility
Loading...
Searching...
No Matches
story.h
1
/* Copyright (c) 2024 Julian Benda
2
*
3
* This file is part of inkCPP which is released under MIT license.
4
* See file LICENSE.txt or go to
5
* https://github.com/JBenda/inkcpp for full license details.
6
*/
7
#pragma once
8
9
#include "types.h"
10
11
namespace
ink::runtime
12
{
25
class
story
26
{
27
public
:
28
virtual
~story
(){};
29
#pragma region Interface Methods
39
virtual
globals
new_globals
() = 0;
43
virtual
globals
new_globals_from_snapshot
(
const
snapshot
& obj) = 0;
44
55
virtual
runner
new_runner
(
globals
store =
nullptr
) = 0;
69
virtual
runner
70
new_runner_from_snapshot
(
const
snapshot
& obj,
globals
store =
nullptr
,
unsigned
runner_id = 0)
71
= 0;
72
77
virtual
hash_t
hash
()
const
= 0;
78
#pragma endregion
79
80
#pragma region Factory Methods
91
static
story
*
from_file
(
const
char
* filename);
92
105
static
story
*
from_binary
(
const
unsigned
char
* data,
size_t
length,
bool
freeOnDestroy =
true
);
106
#pragma endregion
107
};
108
}
// namespace ink::runtime
109
116
121
126
ink::runtime::snapshot
Container for an InkCPP runtime snapshot, which can be migrated.
Definition
snapshot.h:59
ink::runtime::story
A loaded ink story.
Definition
story.h:26
ink::runtime::story::new_globals_from_snapshot
virtual globals new_globals_from_snapshot(const snapshot &obj)=0
Reconstructs globals from snapshot.
ink::runtime::story::new_runner_from_snapshot
virtual runner new_runner_from_snapshot(const snapshot &obj, globals store=nullptr, unsigned runner_id=0)=0
reconstruct runner from a snapshot
ink::runtime::story::from_file
static story * from_file(const char *filename)
Creates a new story object from a file.
ink::runtime::story::hash
virtual hash_t hash() const =0
hash of binary/story.
ink::runtime::story::new_runner
virtual runner new_runner(globals store=nullptr)=0
Creates a new runner.
ink::runtime::story::from_binary
static story * from_binary(const unsigned char *data, size_t length, bool freeOnDestroy=true)
Create a new story object from binary buffer.
ink::runtime::story::new_globals
virtual globals new_globals()=0
Creates a new global store.
ink::runtime
Contaning all modules and classes used for the inkles ink runtime.
Definition
choice.h:13
ink::runtime::globals
story_ptr< globals_interface > globals
alias for an managed ink::runtime::globals_interface pointer
Definition
types.h:20
ink::runtime::runner
story_ptr< runner_interface > runner
alias for an managed ink::runtime::runner_interface pointer
Definition
types.h:22
ink::hash_t
uint32_t hash_t
Name hash (used for temporary variables).
Definition
system.h:85
inkcpp
include
story.h
Generated by
1.17.0