inkcpp
Loading...
Searching...
No Matches
ink::runtime::choice Class Reference

An ink choice that is being presented to the user. More...

#include <choice.h>

Public Member Functions

int index () const
 Choice index.
 
const char * text () const
 Choice text.
 
bool has_tags () const
 does this choice has tags?
 
size_t num_tags () const
 number of tags assoziated with this choice
 
const char * get_tag (size_t index) const
 access tag.
 

Friends

class internal::runner_impl
 

Detailed Description

An ink choice that is being presented to the user.

Contains all the data about a single choice being faced by an ink runner. Of primary concern is the index and the text.

See also
runner

Member Function Documentation

◆ get_tag()

const char * ink::runtime::choice::get_tag ( size_t index) const
inline

access tag.

Parameters
indextag id to fetch [0;num_tags())

◆ index()

int ink::runtime::choice::index ( ) const
inline

Choice index.

Pass this to the runner to choose this choice and have it follow its branch.

Returns
index of the choice. 0 is the first, etc.

◆ num_tags()

size_t ink::runtime::choice::num_tags ( ) const
inline

number of tags assoziated with this choice

See also
has_tags()

◆ text()

const char * ink::runtime::choice::text ( ) const
inline

Choice text.

Text to display to the user for choosing this choice.

Returns
choice text as a string

The documentation for this class was generated from the following file: