inkcpp
Toggle main menu visibility
Loading...
Searching...
No Matches
choice.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
#include "system.h"
9
10
namespace
ink
11
{
12
namespace
runtime
13
{
14
namespace
internal
15
{
16
class
basic_stream;
17
class
runner_impl;
18
class
string_table;
19
class
list_table;
20
}
// namespace internal
21
31
class
choice
32
{
33
public
:
42
int
index
()
const
{
return
_index; }
43
51
const
char
*
text
()
const
{
return
_text; }
52
54
bool
has_tags
()
const
{
return
_tags_start != _tags_end; }
55
59
size_t
num_tags
()
const
;
60
62
const
char
*
get_tag
(
size_t
index
)
const
;
63
64
private
:
65
friend
class
internal::runner_impl;
66
67
uint32_t
path()
const
{
return
_path; }
68
69
choice
& setup(
70
internal::basic_stream&, internal::string_table& strings, internal::list_table& lists,
71
int
index
,
uint32_t
path,
thread_t
thread,
thread_t
scope_thread,
72
const
internal::runner_impl&
runner
,
size_t
tags_start,
size_t
tags_end
73
);
74
75
protected
:
76
const
char
* _text =
nullptr
;
77
const
internal::runner_impl* _runner =
nullptr
;
78
size_t
_tags_start = 0;
79
size_t
_tags_end = 0;
80
uint32_t
_path = ~0U;
81
thread_t
_thread = ~0U;
82
thread_t
_scope_thread = ~0U;
83
int
_index = -1;
84
};
85
86
}
// namespace runtime
87
}
// namespace ink
ink::runtime::choice
An ink choice that is being presented to the user.
Definition
choice.h:32
ink::runtime::choice::has_tags
bool has_tags() const
does this choice has tags?
Definition
choice.h:54
ink::runtime::choice::num_tags
size_t num_tags() const
number of tags associated with this choice
ink::runtime::choice::text
const char * text() const
Choice text.
Definition
choice.h:51
ink::runtime::choice::index
int index() const
Choice index.
Definition
choice.h:42
ink::runtime::choice::get_tag
const char * get_tag(size_t index) const
Access a tag by index.
ink::runtime
Contaning all modules and classes used for the inkles ink runtime.
Definition
choice.h:13
ink::runtime::runner
story_ptr< runner_interface > runner
alias for an managed ink::runtime::runner_interface pointer
Definition
types.h:22
ink
Namespace contaning all modules and classes from InkCPP.
Definition
choice.h:11
ink::uint32_t
unsigned int uint32_t
define basic numeric type
Definition
system.h:71
ink::thread_t
uint32_t thread_t
Used to uniquely identify threads.
Definition
system.h:119
inkcpp
include
choice.h
Generated by
1.17.0