Created
June 15, 2012 21:43
-
-
Save ydnax/2938843 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Level.hpp" | |
#include <iostream> | |
#include <cassert> | |
namespace picppgl{ | |
using namespace std; | |
void Level::update(int ticks){ | |
cout<<"-----level update "<<( objects.data().size() )<<endl; | |
objects.realDelete(); | |
cout<<"-- post gc"<<( objects.data().size() )<<endl; | |
for(auto &&obj: objects.data()){ | |
cout<<"update obj"<<obj<<endl; | |
obj->update(ticks); | |
} | |
} | |
void Level::addObj(levelObject *o){ | |
cout<<"addobj "<<o<<endl; | |
objects.add(o); | |
} | |
void Level::delObj(levelObject *o){ | |
objects.element_delete(o); | |
} | |
bool Level::hasWon(){ | |
return winfun(); | |
} | |
Level::~Level(){ | |
objects.realDelete(); | |
for(auto &&obj: objects.data()){ | |
delete obj; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment