inkcpp
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
11namespace ink::runtime
12{
25class story
26{
27public:
28 virtual ~story(){};
29#pragma region Interface Methods
39 virtual globals new_globals() = 0;
44
55 virtual runner new_runner(globals store = nullptr) = 0;
70 const snapshot& obj, globals store = nullptr, unsigned runner_id = 0
71 ) = 0;
72#pragma endregion
73
74#pragma region Factory Methods
85 static story* from_file(const char* filename);
86
99 static story* from_binary(unsigned char* data, size_t length, bool freeOnDestroy = true);
100#pragma endregion
101};
102}
103
Container for an InkCPP runtime snapshot.
Definition snapshot.h:27
Pointer wrapper to an object whose lifetime is tied to a story object.
Definition story_ptr.h:85
A loaded ink story.
Definition story.h:26
virtual globals new_globals_from_snapshot(const snapshot &obj)=0
Reconstructs globals from snapshot.
virtual runner new_runner_from_snapshot(const snapshot &obj, globals store=nullptr, unsigned runner_id=0)=0
reconstruct runner from a snapshot
static story * from_binary(unsigned char *data, size_t length, bool freeOnDestroy=true)
Create a new story object from binary buffer.
static story * from_file(const char *filename)
Creates a new story object from a file.
virtual runner new_runner(globals store=nullptr)=0
Creates a new runner.
virtual globals new_globals()=0
Creates a new global store.
Contaning all modules and classes used for the inkles ink runtime.
Definition choice.h:13