Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

typescript: parametrize World and System over Entity #248

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

DavidPeicho
Copy link
Contributor

Hi,

This is a super simple PR introducing:

  • <Entity> parametrization in the declaration of World
  • <Entity> parametrization is the declaration of the class System.

Why?

When creating a custom entity, all typings are lost (in favor of the base Entity class) in createEntity and inside inherited systems. It can make the framework a bit unpleasant to use, either because you need to cast first to unknown, or because you need to create an intermediate system class.

@robertlong robertlong merged commit efb4ae1 into ecsyjs:dev Sep 10, 2020
@robertlong
Copy link
Member

LGTM, thank you! I'll update ecsy-three to use this as well.

simonihmig added a commit to simonihmig/ecsy that referenced this pull request Oct 7, 2020
In line with ecsyjs#248, this parameterizes the use of `World` in `System`, allowing you to have a subclass of `World` (a.o. `ecsy-three`) and `System.world` correctly reflecting that.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants