-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add documentation for event filters #379
Conversation
A preview for this pull request is available at https://cdn.rawgit.com/Spongy/SpongeDocs-PRs/67946ed3/index.html. Here are some links to the pages that were modified:
Since the preview frequently changes, please link to this comment, not to the direct url to the preview. |
@@ -0,0 +1,145 @@ | |||
====================================== | |||
Advansed Event Handling: Event Filters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably change this to just 'Event Filters'
Also I spelled 'advanced' wrong...classic
- Stub for Causes page - consistent indentation (tabs -> spaces in filters.rst, 4 spaces per level in custom.rst)
Open questions of lesser priority:
|
No they cannot, I toyed briefly with how to do it but there isn't really a way for a) them to cleanly add the filters to their handler since they are implementing a method that they can't add parameters to, and b) us to cleanly generate/transform their handlers to do the filtering. So bottom line, if you're implementing EventListener yourself you're on your own for filtering.
|
- Listen for events | ||
- Fire events | ||
|
||
Overview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we should get rid of the Overview
heading and the list above. Just some introductory sentences should suffice. If we do this we might remove it on the other topics too.
Is the concept of our events explained anywhere ( |
The events page we have mostly deals with listeners. Causes I introduced as a stub page, issue is #267. |
I'll write a page for causes sometime today |
Looks good so far. Maybe mention that |
@Saladoc I added a note to the bottom of the named cause section https://github.com/SpongePowered/SpongeDocs/pull/379/files#diff-dba86822fc60edfa471b8efba4f5b7e2R85 |
Events are great for the use case of wanting to execute something when certain actions occur, but | ||
they have the drawback of providing next to no context as to what has **caused** that event to | ||
occur. A ``Cause`` allows providing and receiving additional contextual information about the event | ||
which can be do to modify the behavior of your event handler depending on this context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is wrong with this sentence, "which can be do to modify". We can clean up some wording later, but I'm really not sure what you meant to say here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I meant to say ...which can be used to modify...
} | ||
|
||
.. note:: | ||
Both ``@Has`` and ``@Supports`` have an optional parameter ``inverse()`` which can be set to cause validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe remove the brackets?
Looks good. |
This adds documentation for SpongeAPI#927 Event Filters
Please feel free to edit this branch for content/formatting/whatever without asking me for permission.