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

Blocked radius for warzone #5

Closed
wants to merge 1 commit into from
Closed

Blocked radius for warzone #5

wants to merge 1 commit into from

Conversation

unickorn
Copy link

This pull request adds support for a configurable blocked center area that can be used for blocking a warzone players are not meant to /wild into.

/** @var int */
private $radius;

public function __construct(int $min, int $max, int $center, int $radius){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you understand what a closed interval is in mathematics? It literally makes no sense for a closed interval to be having a center and radius properties. 🤔
https://en.wikipedia.org/wiki/Interval_(mathematics)#Terminology

Copy link
Author

@unickorn unickorn May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would moving the center and blocked "radius" (not even sure what to call it) values to the Random2DCoordinateGenerator make more sense? I'm not sure how to go with this.

I mainly wanted to block an inner x by x area from the /wild and reserve it as a warzone people can't /wild into.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random2DCoordinateGenerator serves it's use of generating a random 2D point, it need not do anything more than what's it named for.

A better approach would be to abstract the generation code so other plugins can interfere.
Blocking specific regions isn't something Wilderness should be equipped with. It must be something a region managing plugin should inject — not all regions are rectangular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants