getMatrix method
Retrieves a specific Artifact for a given character.
This method fetches a character definition and returns the matrix at the specified index. If the character definition doesn't exist or the index is out of bounds, an empty matrix is returned.
Parameters:
character: A String representing the character for which to retrieve the matrix. This should be a single character, typically.matricesIndex: An int specifying the index of the desired matrix within the character's definition. Different indices may represent variations or different representations of the character.
Returns:
Implementation
Artifact getMatrix(final String character, final int matricesIndex) {
final CharacterDefinition? definition = getDefinition(character);
if (definition == null ||
matricesIndex < 0 ||
matricesIndex >= definition.matrices.length) {
return Artifact(0, 0);
}
return definition.matrices[matricesIndex];
}