Re: Object Orientation And Game Programming Question

  • From: "QuentinC" <webmaster@xxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 27 Sep 2010 19:32:53 +0200

Hello,
I think you should do it as logical and as similar to the real life as possible.
IN the real life, the player knows only where he is 
In a player perspective, if he want to get informations about other players, he 
should ask his environment. IN this case, the field.

In its side, a field should know who are on it, to be able to give information 
to the players.

You have a bidirectionnal association. 
One side of the association may be useless, depending on the situation, it's 
impossible to tell you without a more precise example. It depends on what a 
player can do with the field, and what the field can do with the players. IN 
the football example, the field would probably be just a container which can 
only let players enter and exit and allow to iterate through the players who 
are in game.

Other related posts: