UNPKG

@awesome-ecs/abstract

Version:

A comprehensive Entity-Component-System (ECS) Architecture implementation. Abstract components.

1 lines 1.51 kB
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/components/identity-component.ts"],"sourcesContent":["import { EntityTypeUid, IEntityModel } from '../entities/entity';\nimport { Immutable } from '../utils/types';\nimport { IComponent } from './component';\n\n/**\n * The `BasicComponentType` enum defines the types of basic components available.\n */\nexport enum BasicComponentType {\n identity = 'identity'\n}\n\n/**\n * IdentityComponent interface represents the basic information regarding what makes the current Entity unique.\n * It extends the IComponent interface.\n *\n * @template TModel - The type of the model that extends IEntityModel.\n */\nexport interface IdentityComponent<TModel extends IEntityModel> extends IComponent {\n /**\n * The Entity Type that defines what Category type the Entity is part of.\n * There can be multiple Entities sharing the same EntityType.\n */\n readonly entityType: EntityTypeUid;\n\n /**\n * The Model is the basic information needed to create an `IEntity` when it's first initialized.\n * It provides a first snapshot of information needed for the successful creation of an Entity instance.\n *\n * @type {Immutable<TModel>}\n */\n readonly model: Immutable<TModel>;\n\n /**\n * Keeps track when the Entity's systems have ran last.\n * Useful to calculate the `DeltaTime` between runs.\n *\n * @type {Date | undefined}\n */\n readonly lastUpdated?: Date;\n}\n"],"mappings":";;;;;AAOA,IAAY,oEAAL;AACL;;AACD"}