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.

Textmode
  • 509
  • 3
  • 18
Liggi
  • 744
  • 8
  • 22

2 Answers2

2

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

ire_and_curses
  • 68,372
  • 23
  • 116
  • 141
  • 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 Oct 07 '10 at 18:18
2

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

See Grammar Monster's explanation.

YYC
  • 1,792
  • 1
  • 14
  • 19
  • 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 Oct 07 '10 at 18:28
  • I've essentially gone for this. I settled with DirectActor and IndirectActor. – Liggi Oct 07 '10 at 18:38