Skip to content

Make ActiveCollisionPublisher/Consumer extend generic class #432

@thestonefox

Description

@thestonefox

The ActiveCollisionPublisher and ActiveCollisionConsumer provide a good, reusable generic pattern of one side of a contract (the publisher) being able to pass a payload on to any consumer and can be limited by any given rule.

At the moment the components only work with active collisions, but most of the code can be moved into an abstract class to offer other mechanisms.

E.g.

A more general GameObject Publisher/Consumer could be used by the Pointer to create interactable elements

E.g.

OnPointerSelected
-> Add Selected GameObject to Publisher List
-> Call Publish

if the selected GameObject has a Consumer then it can digest the method and do something.

Also, if it used an ObservableList to store the contents and the ObsList was updated to take a validity rule so only objects that are considered valid can be added to the obs list, then this would mean both the publisher and consumer could impose restrictions.

At the moment only the consumer can choose to ignore all publishers sending it a message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementMaking something better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions