views:

26

answers:

2

This is a difficult one, I've been racking my brains but I just come up with a sensible name for these variables. Someone will probably instantly hit on one.

Take these example actions:

  • "throw bottle at wall"
  • "push John into door"
  • "attack Ogre with sword"

action thing at/with/on/in/to thing

I need a sensible name for the first "thing", and a sensible name for the second "thing" if I had to define a variable for each. So... like "Interactor" and "Interactee"... but a proper name.

I've been trying to explain this to a few people and I can't seem to get the concept across, so feel free to ask me to clarify.

+1  A: 

When I last worked on a text adventure, I just went with subject and object, their grammatical names.

ire_and_curses
It is OO code, but it's a lot more generic than subject.action(object). Each IActionable object has a list of Interactions which can include (or not) another object. Subject and Object are things I have considered, but the Object could be a Character.... which doesn't really work.
Liggi
+1  A: 

The two "things" in your example seem to me the "direct object" and the "indirect object."

See Grammar Monster's explanation.

YYC
Grammatically correct... but I don't think I want them both to have the word "object" in them. I did learn something from that though, so thank you! :)
Liggi
I've essentially gone for this. I settled with DirectActor and IndirectActor.
Liggi