X-Git-Url: http://git.localhorst.tv/?p=space.git;a=blobdiff_plain;f=src%2Fworld%2FUniverse.cpp;fp=src%2Fworld%2FUniverse.cpp;h=0866af32f600c12581deed44c9e2dc4190872d5a;hp=c5bb915805a324cd240541ffb2f12173cf44d39b;hb=7bf949b332c410c6909fe80d9fc0ba2200f4ef19;hpb=501ffe20da16eaab69e668871001f735697c4a42 diff --git a/src/world/Universe.cpp b/src/world/Universe.cpp index c5bb915..0866af3 100644 --- a/src/world/Universe.cpp +++ b/src/world/Universe.cpp @@ -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) {