Ejemplo n.º 1
0
void FieldWidget::handleStatus(const Status &status)
{
    if (status->has_world_state()) {
        m_worldState.CopyFrom(status->world_state());
        m_worldStateUpdated = true;
    }

    if (status->has_game_state()) {
        m_gameState.CopyFrom(status->game_state());
    }

    if (status->has_team_blue()) {
        updateTeam(m_robotsBlue, m_teamBlue, status->team_blue());
    }

    if (status->has_team_yellow()) {
        updateTeam(m_robotsYellow, m_teamYellow, status->team_yellow());
    }

    if (status->has_geometry()) {
        m_geometry.CopyFrom(status->geometry());
        m_geometryUpdated = true;
    }

    if (status->has_debug()) {
        // just save status to avoid copying the visualizations
        m_visualizations[status->debug().source()] = status;
        m_visualizationsUpdated = true;
    }
}