Skip to main content

A type-hinted Entity Component System based on Python dictionaries and sets.

Project description

About

PyPI PyPI - License Documentation Status codecov

This is an Entity-component-system implemented in Python. See the ECS FAQ for more info.

This implementation focuses on type-hinting, organization, and is designed to work well with Python. The following features are currently implemented:

  • Entities can have store components which are instances of any Python object. Components are looked up by their type.
  • Entities can have one instance of a type, or multiple instances of a type with a string or other hashable to differentiate them.
  • Components can be registered as abstract, allowing a base type to hold subclasses of that component.
  • Entity tags are distinct from components, tags are any hashable Python object rather than empty class.
  • Entity relationships are supported, either as many-to-many or many-to-one relationships.
  • ECS Queries can be made to fetch entities having a combination of components/tags/relations or the absence of such.

A lightweight version which implements only the entity-component framework exists called tcod-ec.

Installation

Use pip to install this library:

pip install tcod-ecs

If tcod is installed and the version is less than 14.0.0 then import tcod.ecs will fail. Remove or update tcod to fix this issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tcod-ecs-0.1.0.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

tcod_ecs-0.1.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page