Page 1 of 1
Minimal Implimentations for Cafu
Posted: 2011-02-08, 20:44
by volto
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
Re: Minimal Implimentations for Cafu
Posted: 2011-02-09, 01:06
by Carsten
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.