Skip to content

Commit

Permalink
fix: add line follow to mathieu device
Browse files Browse the repository at this point in the history
  • Loading branch information
AxelF44 committed Jun 22, 2024
1 parent a357545 commit 2fc0a64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 0 additions & 8 deletions gui/src/Engine/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ void Gui::Engine::listenServer()

void Gui::Engine::sendMessageUpdate()
{
// updateMap();

clock_t currentTick = clock();

if ((int)(_gameData->getServerTick()) == NO_TICK && (float)(currentTick - _gameData->getLastTick()) / CLOCKS_PER_SEC < 1)
Expand All @@ -69,12 +67,6 @@ void Gui::Engine::sendMessageUpdate()
return;
_gameData->restartLastTick();

// _network.get()->sendMessageServer("sgt\n");
// for (auto &team : _gameData.get()->getTeams()) {
// for (auto &player : team.getPlayers()) {
// _network.get()->sendMessageServer("ppo " + std::to_string(player.getId()) + "\n");
// }
// }
if (_gameData.get()->getTimeUnitFromServer() == GameData::TimeUnitState::INCREASE)
_network.get()->sendMessageServer("sst " + std::to_string(_gameData.get()->getServerTick() + 1) + "\n");
else if (_gameData.get()->getTimeUnitFromServer() == GameData::TimeUnitState::DECREASE) {
Expand Down
2 changes: 2 additions & 0 deletions gui/src/GUIUpdater/GUIUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ void Gui::GUIUpdater::updatePlayerRessourceDropping(const std::vector<std::strin
for (auto &player : team.getPlayers()) {
if (player.getId() == args[0]) {
player.setState(Gui::Player::PlayerState::DROP);
player.inventory.addResource(args[1], 1);
_gameData.get()->getTile(player.getPosition().first, player.getPosition().second).inventory.addResource(args[1], 1);
return;
}
Expand Down Expand Up @@ -411,6 +412,7 @@ void Gui::GUIUpdater::updatePlayerRessourceCollecting(const std::vector<std::str
for (auto &player : team.getPlayers()) {
if (player.getId() == args[0]) {
player.setState(Gui::Player::PlayerState::COLLECT);
player.inventory.addResource(args[1], 1);
_gameData.get()->getTile(player.getPosition().first, player.getPosition().second).inventory.removeResource(args[1], 1);
return;
}
Expand Down

0 comments on commit 2fc0a64

Please sign in to comment.