Skip to content

Instantly share code, notes, and snippets.

@ydnax
Created June 15, 2012 21:43
Show Gist options
  • Save ydnax/2938843 to your computer and use it in GitHub Desktop.
Save ydnax/2938843 to your computer and use it in GitHub Desktop.
#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