template<int MaxSize>
bn::sprite_cached_animate_action class

Changes the tile set of a sprite_ptr when the action is updated a given number of times.

Template parameters
MaxSize Maximum number of sprite tile sets to store.

This action differs from sprite_animate_action in that all sprite tile sets to use are cached, so it is faster but takes way more VRAM.

Base classes

class isprite_cached_animate_action
Base class of bn::sprite_cached_animate_action.

Public static functions

static auto once(const sprite_ptr& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.
static auto once(sprite_ptr&& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.
static auto once(const sprite_ptr& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.
static auto once(sprite_ptr&& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.
static auto forever(const sprite_ptr& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.
static auto forever(sprite_ptr&& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.
static auto forever(const sprite_ptr& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.
static auto forever(sprite_ptr&& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list) -> sprite_cached_animate_action
Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.

Constructors, destructors, conversion operators

sprite_cached_animate_action(const sprite_cached_animate_action& other)
Copy constructor.
sprite_cached_animate_action(sprite_cached_animate_action&& other) noexcept
Move constructor.
sprite_cached_animate_action(const isprite_cached_animate_action& other)
Copy constructor.

Public functions

auto operator=(const sprite_cached_animate_action& other) -> sprite_cached_animate_action&
Copy assignment operator.
auto operator=(sprite_cached_animate_action&& other) -> sprite_cached_animate_action& noexcept
Move assignment operator.
auto operator=(const isprite_cached_animate_action& other) -> sprite_cached_animate_action&
Copy assignment operator.
auto operator=(isprite_cached_animate_action&& other) -> sprite_cached_animate_action& noexcept
Move assignment operator.

Function documentation

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::once(const sprite_ptr& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.

Parameters
sprite sprite_ptr to copy.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_item It creates the new sprite tiles to use by the given sprite_ptr.
graphics_indexes Indexes of the tile sets to reference in tiles_item.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::once(sprite_ptr&& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.

Parameters
sprite sprite_ptr to move.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_item It creates the new sprite tiles to use by the given sprite_ptr.
graphics_indexes Indexes of the tile sets to reference in the given sprite_tiles_item.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::once(const sprite_ptr& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.

Parameters
sprite sprite_ptr to copy.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_list List of tile sets to use by the given sprite_ptr.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::once(sprite_ptr&& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets only once.

Parameters
sprite sprite_ptr to move.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_list List of tile sets to use by the given sprite_ptr.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::forever(const sprite_ptr& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.

Parameters
sprite sprite_ptr to copy.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_item It creates the new sprite tiles to use by the given sprite_ptr.
graphics_indexes Indexes of the tile sets to reference in tiles_item.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::forever(sprite_ptr&& sprite, int wait_updates, const sprite_tiles_item& tiles_item, const span<const uint16_t>& graphics_indexes)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.

Parameters
sprite sprite_ptr to move.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_item It creates the new sprite tiles to use by the given sprite_ptr.
graphics_indexes Indexes of the tile sets to reference in the given sprite_tiles_item.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::forever(const sprite_ptr& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.

Parameters
sprite sprite_ptr to copy.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_list List of tile sets to use by the given sprite_ptr.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
static sprite_cached_animate_action bn::sprite_cached_animate_action<MaxSize>::forever(sprite_ptr&& sprite, int wait_updates, span<sprite_tiles_ptr> tiles_list)

Generates a sprite_cached_animate_action which loops over the given sprite tile sets forever.

Parameters
sprite sprite_ptr to move.
wait_updates Number of times the action must be updated before changing the tiles of the given sprite_ptr.
tiles_list List of tile sets to use by the given sprite_ptr.
Returns The requested sprite_cached_animate_action.

template<int MaxSize>
bn::sprite_cached_animate_action<MaxSize>::sprite_cached_animate_action(const sprite_cached_animate_action& other)

Copy constructor.

Parameters
other sprite_cached_animate_action to copy.

template<int MaxSize>
bn::sprite_cached_animate_action<MaxSize>::sprite_cached_animate_action(sprite_cached_animate_action&& other) noexcept

Move constructor.

Parameters
other sprite_cached_animate_action to move.

template<int MaxSize>
bn::sprite_cached_animate_action<MaxSize>::sprite_cached_animate_action(const isprite_cached_animate_action& other)

Copy constructor.

Parameters
other isprite_cached_animate_action to copy.

template<int MaxSize>
sprite_cached_animate_action& bn::sprite_cached_animate_action<MaxSize>::operator=(const sprite_cached_animate_action& other)

Copy assignment operator.

Parameters
other sprite_cached_animate_action to copy.
Returns Reference to this.

template<int MaxSize>
sprite_cached_animate_action& bn::sprite_cached_animate_action<MaxSize>::operator=(sprite_cached_animate_action&& other) noexcept

Move assignment operator.

Parameters
other sprite_cached_animate_action to move.
Returns Reference to this.

template<int MaxSize>
sprite_cached_animate_action& bn::sprite_cached_animate_action<MaxSize>::operator=(const isprite_cached_animate_action& other)

Copy assignment operator.

Parameters
other isprite_cached_animate_action to copy.
Returns Reference to this.

template<int MaxSize>
sprite_cached_animate_action& bn::sprite_cached_animate_action<MaxSize>::operator=(isprite_cached_animate_action&& other) noexcept

Move assignment operator.

Parameters
other ivector to move.
Returns Reference to this.