• Create Account

### #ActualNightCreature83

Posted 12 June 2013 - 03:53 PM

But that adds 4/8 bytes to the object size :c

And it doesnt have the fancy implicit context vars o,o

Hey I could also have written this in system instead which adds nothing to the object size of System:
class System
{
public:
void Update()
{
SimpleInterface simpleInterface;
if ( simpleInterface.initialise( Resource::GetResourcePointer() ) )
{
std::string playerName = simpleInterface.getPlayerName();
}
}
};

Not saying the singleton implementation is cleaner or even preferred but there are ways around the fact that a system would have to store a resource pointer.
The fact is with the transient interface is that over time you write less code as well as you are reusing these everywhere where you would need access to the functionality it exposes.

### #1NightCreature83

Posted 12 June 2013 - 03:50 PM

But that adds 4/8 bytes to the object size :c

And it doesnt have the fancy implicit context vars o,o

Hey I could also have written this in system instead which adds nothing to the object size of System:
class System
{
public:
void Update()
{
SimpleInterface simpleInterface;
if ( simpleInterface.initialise( Resource::GetResourcePointer() ) )
{
std::string playerName = simpleInterface.getPlayerName();
}
}
};


PARTNERS