Actor#getInteractingEntity vs getTarget

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

  1. Cloud

    Cloud The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,323
    Likes Received:
    754
    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 The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,323
    Likes Received:
    754
    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:
    504
    Likes Received:
    159
    What about the best of both worlds? Actor#interactionTarget
     
  5. dog_

    dog_ 0xCAFEBABE

    Joined:
    Nov 3, 2013
    Messages:
    271
    Likes Received:
    55

Share This Page

Loading...