import { ResourceOptions, ResourceType } from './types'; import CanvasElementPlugin from '../elements/plugin/abstract/CanvasElementPlugin'; import { TransformPermissions } from '../elements/abstract'; import Image from '../../misc/image/Image'; /** * A resource includes data to construct icons or entities * @author Eirik Måseidvåg */ export default class Resource { /** * The label of the resource */ label: string; /** * The image of the resource to be used on the canvas * @public */ icon: Image; /** * The width of the resource on the canvas * @public */ width: number; /** * The height of the resource on the canvas * @public */ height: number; /** * Determines weather or not the color of the team the entity belongs to should be tinted on the icon on the canvas * Only if resource is an entity * @public */ useTeamTint: boolean; /** * Determines which transforms are allowed to be preformed */ permissions: TransformPermissions; /** * Determines if the canvas element should be displayed for only a set period of time * @public */ readonly temporary: boolean; /** * Return the type of the resource * @returns ResourceType */ type: ResourceType; /** * The resource plugin for the canvas * @public */ plugins: Array; /** * The text that goes under the label for the entity inside the teams list of entities */ caption: string; /** * The picture to be used for this icon in non canvas situations */ picture: Image; /** * Determines weather or not the resource should be displayed on the default bar * Only the most frequently used resource should be default resource */ isDefault: boolean; /** * The categories the resource falls under * This can be 'Marksman' for league of legends, 'Utility' etc. * Should use the pretty name as it will be displayed in the filter. */ categories: Array; /** * Construct the resource * @param options */ constructor(options: ResourceOptions); }