Recommended Posts

Hello all, I have a probelem, I have two classes Game Engine and Game Layer. Game engine handles all the input and output with the user. While Game layer handles all the game specific code. My problem is I want them to comunicate with each other. But I get a compiler error when ever I try to compile them since they each have a pointer to the other.
Is there away to get this working?
-----------------------------------------------------
Writer, Programer, Cook, I''m a Jack of all Trades
Current Design project
Chaos Factor Design Document

0

Share this post

Link to post

Share on other sites

The solution is to use forward declarations. Also as a sidenote, I personally wouldn''t allow the engine to access any members of the game class. Otherwise, your engine class is likely going to be not very reusable.