Skip to content

Commit

Permalink
Added Hk::Solar::ExistsAndAlive() wrapper method
Browse files Browse the repository at this point in the history
  • Loading branch information
Aingar committed Aug 28, 2023
1 parent b03b325 commit f8b75f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/API/FLServer/Solar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ namespace Hk::Solar
DLL Action<Universe::IBase*, Error> GetBaseByWildcard(std::wstring_view targetBaseName);
DLL Action<uint, Error> GetAffiliation(BaseId solarId);
DLL Action<float, Error> GetCommodityPrice(BaseId baseId, GoodId goodId);
DLL Action<bool, Error> ExistsAndAlive(uint id);
} // namespace Hk::Solar
13 changes: 13 additions & 0 deletions source/API/FLServer/Solar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,17 @@ namespace Hk::Solar
}
return { price };
}

Action<bool, Error> ExistsAndAlive(uint id)
{
int isAlive = pub::SpaceObj::ExistsAndAlive(id);
if (isAlive == 0)
{
return { true };
}
else
{
return { false };
}
}
} // namespace Hk::Solar

0 comments on commit f8b75f6

Please sign in to comment.