Commit 8dbf61ea authored by Hubert Denkmair's avatar Hubert Denkmair
Browse files

Merge branch 'proposal/mass_in_bot_stats' into 'dev'

BotStats: added mass to message

See merge request GPN18Programmierspiel/gameserver!18
parents 14437ade 6afa70db
......@@ -128,6 +128,7 @@ namespace MsgPackProtocol
double natural_food_consumed;
double carrison_food_consumed;
double hunted_food_consumed;
double mass;
};
struct BotStatsMessage
......@@ -348,6 +349,7 @@ namespace msgpack {
o.pack(v.natural_food_consumed);
o.pack(v.carrison_food_consumed);
o.pack(v.hunted_food_consumed);
o.pack(v.mass);
return o;
}
};
......
......@@ -154,6 +154,7 @@ void MsgPackUpdateTracker::botStats(const std::shared_ptr<Bot> &bot)
item.natural_food_consumed = bot->getConsumedNaturalFood();
item.carrison_food_consumed = bot->getConsumedFoodHuntedByOthers();
item.hunted_food_consumed = bot->getConsumedFoodHuntedBySelf();
item.mass = bot->getSnake()->getMass();
m_botStatsMessage->items.push_back(item);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment