Skip to content

Exclusion interface only matches if all components are present #60

@TheLazyLemur

Description

@TheLazyLemur

I noticed the exclusion interface only excluded entities if all those components are present on an entity.

The behaviour I assumed was if one or all of the components on the exclude interface are on an entity it will exclude the entity.

Is the current behaviour the expected behaviour?

type NotMovementFace interface {
	GetDropComponent() *components.DropComponent
	GetTargetComponent() *components.TargetComponent
}

type NotMoveable interface {
	ecs.BasicFace
	NotMovementFace
}

// Will be excluded
type Enemy struct {
	ecs.BasicEntity
	SpaceComponent
	VelocityComponent
	TargetComponent
	DropComponent
}

// Wil not be excluded
type Bullet struct {
	ecs.BasicEntity
	SpaceComponent
	VelocityComponent
	DropComponent
}

In the example above I would expect any entities with either drop. target or both get excluded?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions