Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComponentMatchingFamily.componentAddedToEntity check added component #28

Closed
Kalinovych opened this issue Jul 6, 2013 · 1 comment
Closed

Comments

@Kalinovych
Copy link

Hi Richard,
I have noticed that the componentAddedToEntity() function has no check is added component required by this family's NodeList as it made in componentRemovedFromEntity.

public function componentAddedToEntity( entity : Entity, componentClass : Class ) : void
{
    addIfMatch( entity );
}

public function componentRemovedFromEntity( entity : Entity, componentClass : Class ) : void
{
    if( components[componentClass] )
    {
        removeIfMatch( entity );
    }
}

Maybe you skipped this check consciously because it can cause some issues?
Or function componentAddedToEntity can look like:

public function componentAddedToEntity( entity : Entity, componentClass : Class ) : void
{
    if( components[componentClass] )
    {
        addIfMatch( entity );
    }
}
@Kalinovych
Copy link
Author

#27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant