Minimal Implimentations for Cafu

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
Post Reply
volto
Posts:12
Joined:2011-01-19, 19:06
Location:Germany (NDS)
Minimal Implimentations for Cafu

Post by volto » 2011-02-08, 20:44

Hi Carsten,
i have a little Question over the DeathMatch.cpp,
the Line

Code: Select all

return &cf::GameSys::GameImplT::GetInstance();
returns the Current Game based on a Template but why is this Template definition Located in the DeathMatch/Code directory?

MfG
volto
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Minimal Implimentations for Cafu

Post by Carsten » 2011-02-09, 01:06

Hi volto,
volto wrote:

Code: Select all

return &cf::GameSys::GameImplT::GetInstance();
returns the Current Game based on a Template but why is this Template definition Located in the DeathMatch/Code directory?
What do you mean by template? (I see nothing related to templates in DeathMatch.cpp.)

The return value is a pointer to an implementation of the cf::GameSys::GameI interface.
That "interface" (or rather, abstract base class, "ABC") is implemented by class cf::GameSys::GameImplT (the T is just for "type"). It is in the DLL because that way all code for a game is in a common DLL and can thus dynamically be loaded at runtime.
Best regards,
Carsten
Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests