The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

  Game::Asset::Type - Role for asset types

DESCRIPTION

Each file in the asset archive is represented by a class that does this role. Types are determined by Game::Asset using the file extension.

PROVIDES

process_content

This is called with the full data. If it's the first time the data was passed, then it calls _process_content() and sets has_been_processed() to true.

name

The short name (without extension) of the asset.

full_name

The full name (with extension) of the asset.

has_been_processed

Boolean. If true, then the asset data has already been passed once to process_content().

_orig_content

The _process_content() method should set this to the original, untouched data passed in.

REQUIRES

type

Returns the name of the type.

_process_content

Passed the untouched data so it can be processed.