1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Actor#getInteractingEntity vs getTarget

Discussion in 'Programming & Hardware' started by Cloud, Nov 4, 2014.

  1. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    The api currently includes Actor#getInteractingEntity, I want to rename it to getTarget. Before I do this change I want feedback, and as much as possible. So please, express your opinions and feel free to add or debate anything in this list. I really want to get this method renamed, so if getTarget doesn't satisfy you, I'd like an alternative.

    Pros
    • getTarget more accurately reflects that it's a one way interaction
    • It's primarily used for combat
    • It's short and easy to understand
    Cons
    • getInteractingEntity more accurately reflects that it can also store the entity your talking to or trying to pick pocket
     
  2. phl0w

    Joined:
    Nov 5, 2014
    Messages:
    9
    Likes Received:
    0
    I don't see what the problem is with keeping it #getInteractingEntity?

    1: You are calling getInteractingEntity on an Actor, anyone with half a brain would understand that it is an one way interaction (a player can be attacked by a npc but that doesn't mean the player is interacting with the npc)
    2: Like you said at your cons there are multiple ways to utilize the method
    3: What's difficult to understand about interacting entity?
     
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    It's just not 100% accurate. We had a semi-heated skype discussion about it yesterday and we did a bunch of research to try to figure out exactly what words would be both accurate and common enough for simple usage. Things we considered were target, focus, fixation, and many variations. At the end the one that I'm preferring best is getTarget.
     
  4. Ozzy

    Joined:
    Nov 5, 2014
    Messages:
    505
    Likes Received:
    162
    What about the best of both worlds? Actor#interactionTarget
     
  5. dog_

    Joined:
    Nov 3, 2013
    Messages:
    277
    Likes Received:
    95

Share This Page

Loading...