Skip to content

Permit unregistering commands through ownership #8

Description

@20milliliter

Currently, it is impossible to unregister commands because:
A. no obvious good means of implementation was thought of during development,
B. doing so was not necessary in my own uses of the addon.

However, unregistering commands may be necessary if:

  1. Command Arguments or Callback()(s) references a freed object
  2. The game is in a state where certain commands makes no sense to execute

Case 2 has multiple ways solutions (commands all error, prefixed Condition(s), unregister the commands), none of which feel "most correct". For those situations, I will leave the choice to the developer. Case 1, however, has no solution without this addition. Limiting the context from a vague "allow command unregistration" to this specific problem case, a system involving ownership seems best.

Argument nodes in ArgumentGraph should have a list of owners, that are objects that have registered commands that involve them. A node can have multiple owners. CommandServer can be given an object reference, and remove its ownership of any nodes it owns, then separately (and probably not automatically) be told to prune the ArgumentGraph of nodes which have no owners.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions