TapestryEngine

A 2D Platformer Game Engine
Log | Files | Refs

697b73cbb21509ece25086bce86bf2f4885e721d.svn-base (659B)


      1 #include "Context.h"
      2 
      3 bool ContextManager::LogContext(Context* con, char* name)
      4 {
      5 	mContexts.push_back(con);
      6 	mNames.push_back(name);
      7 	return false;
      8 }
      9 
     10 bool ContextManager::LoadContext(char* ContextName)
     11 {
     12 	for (int i = 0; i < (int)mNames.size(); i++)
     13 	{
     14 		if (!strcmp(ContextName, mNames.at(i)))
     15 		{
     16 			mContexts.at(i)->Load(mGameDataPath);
     17 			mActiveContext = mContexts.at(i);
     18 			return true;
     19 		}
     20 	}
     21 	gCons->ConsPrintf("Unable to load context; No context matching name %s was found\n", ContextName);
     22 	return false;
     23 }
     24 
     25 bool ContextManager::ContextUpdate()
     26 {
     27 	return mActiveContext->Update();
     28 }
     29 
     30 bool ContextManager::EventProcess(Event eve)
     31 {
     32 	return false;
     33 }