Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jochen Bauer
spn-gameserver
Commits
6afa70db
Commit
6afa70db
authored
May 08, 2018
by
Thomas Kolb
Browse files
BotStats: added mass to message
parent
8ac6e3ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/MsgPackProtocol.h
View file @
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
;
}
};
...
...
src/MsgPackUpdateTracker.cpp
View file @
6afa70db
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment