#include "log.h" #include "game_objects.h" #include "abstract_container.h" using namespace OpenGTA; class ConcreteContainer : public AbstractContainer, public AbstractContainer { public: template void add(const T & t) { AbstractContainer::doAdd(t); } Car & getCar(uint32_t id) { return AbstractContainer::doGet(id); } Pedestrian & getPed(uint32_t id) { return AbstractContainer::doGet(id); } void removeCar(uint32_t id) { AbstractContainer::doRemove(id); } void removePed(uint32_t id) { AbstractContainer::doRemove(id); } void realRemove() { AbstractContainer::doRealRemove(); AbstractContainer::doRealRemove(); } }; int main(int argc, char* argv[]) { Car c1(1); Pedestrian p1(20); Car c2(20); ConcreteContainer cc; cc.add(p1); cc.add(c1); cc.add(c2); Car & c = cc.getCar(1); INFO << c.carId << std::endl; Pedestrian & p = cc.getPed(20); cc.removeCar(20); cc.realRemove(); c = cc.getCar(20); }