Help on Organization

Discussion in 'Plugin Development' started by Fl1pzta, Jul 21, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Fl1pzta

    In my plugin I have buildings within sub regions within kingdoms, although I'm unsure how to handle some events and organizing them.

    For example, I know how to get whenever a player enters a building region, but where should I put this for maximum flexibility. Should I make a separate class and call it PlayerBuildingEnter? Also, should have PlayerFellowBuildingEnter or what? Just want some opinions on the matter.
     
  2. Offline

    caseif

    This really depends on what exactly you want to do with the information you're using. I'd recommend creating a new event called PlayerBuildingEnter, and then creating a listener which handles event. You should include the player, location, building data, and a piece of data which can be used to find if the building is friendly (you may have already put this in a Building class, in which case you don't need to include it separately in the event).
     
  3. Offline

    Fl1pzta

    Thanks, but I have no idea how to create a listener. lol AngryNerd
     
  4. Offline

    caseif

    You've much to learn, then. Perhaps you know what it is, but you don't know the name: it's the same type of code you'd use to listen to a PlayerInteractEvent.
     
  5. Offline

    Fl1pzta

    I'ma take a swig. Thanks!
     
Thread Status:
Not open for further replies.

Share This Page