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

Selectors #10

Open
CortexPE opened this issue Jun 4, 2019 · 5 comments
Open

Selectors #10

CortexPE opened this issue Jun 4, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@CortexPE
Copy link
Owner

CortexPE commented Jun 4, 2019

How should this work... literally.

The only thing that I can think of that would be "good enough" is a separate SelectableEntityArgument class which would be parsed and the results will be an array of results.

The array will contain entities that satisfied the conditions given by the user... such as name, limit, etc.

This would also involve running onRun several times for each argument that is selectable and for each of its results. Then $args["argumentName"] will contain an entity for every iteration.

This is a simply but effective way of doing it, but I still have some thoughts that it's dirty.

Leave suggestions below...

@CortexPE CortexPE added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Jun 4, 2019
@CortexPE CortexPE self-assigned this Jun 4, 2019
@CortexPE CortexPE pinned this issue Jun 4, 2019
@CortexPE
Copy link
Owner Author

CortexPE commented Jun 4, 2019

There should also be selectable block positions / vector3 positions... ree

This one should be done on Vector3Argument

@lukeeey
Copy link

lukeeey commented Jun 4, 2019

Why would you run onRun() multiple times? Just return the array of entities in the argument class and the command can loop over them or whatever?

@CortexPE
Copy link
Owner Author

CortexPE commented Jun 4, 2019

Sure, that'd be better

@jasonw4331
Copy link
Contributor

ad5001 already implemented this sometime ago Maybe his project can provide some answers
https://github.com/Ad5001/PlayerSelectors

@CortexPE
Copy link
Owner Author

CortexPE commented Jun 5, 2019

It's unreadable 😂

https://github.com/Ad5001/PlayerSelectors/blob/master/src/Ad5001/PlayerSelectors/selector/Selector.php#L105-L122
why doesn't github show code snippets smfh

I might implement a way to build your own parsers and selectors... and the default provided TargetArgument will have the vanilla ones. for the sake of customizability and extensibility

@CortexPE CortexPE unpinned this issue Jun 5, 2019
@inxomnyaa inxomnyaa self-assigned this Sep 22, 2021
jasonw4331 added a commit to jasonw4331/Commando that referenced this issue Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants