OvercastNetwork / SportBukkit

CraftBukkit and Bukkit modifications that improve stability and add new features
100 stars 85 forks source link

Common interface for all things associated with a World #168

Closed jedediah closed 9 years ago

jedediah commented 9 years ago

Add an interface called WorldThing (better suggestion?) with a single method getWorld(). The interface is implemented by pretty much everything that already has that method, plus a few more. It's also implemented by every Event subclass that is world-specific. Events are where this is particularly useful, since it was previously quite complex to get an event's world in a general way.

Complete list of WorldThing inheritors (anything missing?):

twizmwazin commented 9 years ago

I can't help but think that WorldThing is kinda an odd name for an interface.

jedediah commented 9 years ago

As stated in the PR, I'm open to better suggestions.

twizmwazin commented 9 years ago

Maybe something like WorldContent or WorldObject

kashike commented 9 years ago

WorldProvider, WorldHolder

ElliottWhyman commented 9 years ago

WorldContainer?

Also what about implementing it in WeatherEvent?

jedediah commented 9 years ago

WeatherEvent already implements it

ElliottWhyman commented 9 years ago

ah, didn't see it in the list, so I assumed it wasn't included

jedediah commented 9 years ago

WorldThing is still my favorite name so far. I don't want a name that implies the world is owned by the object, since it should be the other way around. And I don't like redundant words like "Object".

I'm considering Physical

rmsy commented 9 years ago

WorldBound? Assuming everything that implements it will only be associated with a single world.

jedediah commented 9 years ago

I went with Physical