0 Replies Latest reply: Oct 6, 2010 7:15 AM by 803453 RSS

    multiple class iteractions

    803453
      Hello,
      I'm re-writing a game and basically I have 3 big classes: the net, the players and the physic.
      they have to exchange some message, and the response may vary depending if and how the message is valid and has been processed.

      My actual implementation is a set of Action object for Player, Physic and Net; they have a RUN method that take as input Player or Physic or Net(we can say it's container) and modify it: for example I read from the net an Action, this Action has a run method that want in input the Net, modify something (if necessary), then create an Action that take as input in his run a Payer obj and it will be send to Player... again run, a new Action for physic and so on...

      A friend of mine suggest a that the Action class only have to contain the parameter and a flag to the function to use, so the "run" code is directly in the Player, Physic and Net class.......

      well the idea are more complicated, but hope you get the point.

      What you think this is the best way? And why? do you suggest another way?
      pleeese help and contribute, i'll love you very much