Would this be better in the actual class?

Programming, for all ages and all languages.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Would this be better in the actual class?

Post by earlz »

I am making a robot AI thing...well, the AI is stored in an instruction set...I put a robot is in class Robot, now I have begun making a file for executing the instructions..(using a namespace also)...now, the instruction set has to access a robot all the time..therefor you must basically pass a this pointer, but my Robot class is already pretty big..I feel it may be kind of bloated if I were to add the entire instruction set(and parts of the decoder) into the Robot class though ...

what should I do? :?

My only other idea is to use friend classes(is that possible?) but even then, wouldn't you still need to pass a pointer to the current Robot class!?
User avatar
Kevin McGuire
Member
Member
Posts: 843
Joined: Tue Nov 09, 2004 12:00 am
Location: United States
Contact:

Post by Kevin McGuire »

You might have been able to build a base class with the primitive functionality such as a memory and the interpretor, then derive a advanced robot class from that which supports the sensory and what not.
Post Reply