Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarItemRecipe.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-06-03 15:47:18 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-06-03 15:47:18 +1000
commit5d1e85b24154dea8ccf0fc98e54a5c0cbf32453c (patch)
treefa9bf4dbe72f0244bcdac361ef44060f421a7971 /source/game/StarItemRecipe.cpp
parentadd17da988f4518c451abc4d0bacf536071e1c0b (diff)
player.availableRecipes and root.allRecipes
Diffstat (limited to 'source/game/StarItemRecipe.cpp')
-rw-r--r--source/game/StarItemRecipe.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/game/StarItemRecipe.cpp b/source/game/StarItemRecipe.cpp
index 7295cd1..1ba4b70 100644
--- a/source/game/StarItemRecipe.cpp
+++ b/source/game/StarItemRecipe.cpp
@@ -5,9 +5,10 @@
namespace Star {
-Json ItemRecipe::toJson() {
+Json ItemRecipe::toJson() const {
JsonArray inputList;
- for (auto input : inputs)
+ inputList.reserve(inputList.size());
+ for (auto& input : inputs)
inputList.append(input.toJson());
return JsonObject{
@@ -21,7 +22,7 @@ Json ItemRecipe::toJson() {
};
}
-bool ItemRecipe::isNull() {
+bool ItemRecipe::isNull() const {
return currencyInputs.size() == 0 && inputs.size() == 0 && output.isNull();
}