/* ecsjs is an entity component system library for JavaScript Copyright (C) 2014 Peter Flannery This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ /** * Thrown when trying to register a component that is missing a 'name' parameter * @category Errors */ export class ComponentTypeKeyMissing extends Error { constructor() { super(`Component type is missing the 'name' parameter. i.e. a constructor name`); } } /** * Thrown when trying to access a component that has not been registered * @param componentName - The name of the unregistered component * @category Errors */ export class ComponentNotRegistered extends Error { constructor(public componentName: string) { super(`Component map does not exist for '${componentName}'`); } } /** * Thrown when trying to register a component that has already been registered * @param componentName - The name of the already registered component * @category Errors */ export class ComponentAlreadyRegistered extends Error { constructor(public componentName: string) { super(`Component '${componentName}' is already registered`); } }