]> git.localhorst.tv Git - space.git/blobdiff - src/world/Universe.cpp
added resources
[space.git] / src / world / Universe.cpp
index c5bb915805a324cd240541ffb2f12173cf44d39b..0866af32f600c12581deed44c9e2dc4190872d5a 100644 (file)
@@ -23,6 +23,12 @@ Ship *Universe::AddShip(const Ship &s) {
        return &ships.back();
 }
 
+int Universe::AddResource(const Resource &r) {
+       resources.emplace_back(r);
+       resources.back().id = resources.size();
+       return resources.back();
+}
+
 
 void Universe::Update(float delta) {
        for (Ship &s : ships) {