<commit_before>#include "WorldModel.hpp"

#include <QObject>
#include <iostream>
#include <vector>

#include "Robot.hpp"
#include "Ball.hpp"

using namespace Modeling;

WorldModel::WorldModel() :
	Module("World Model")
{

//   blueTeam = new std::vector<Robot*>;
//   yellowTeam = new std::vector<Robot*>;
//   for (unsigned int i = 0; i<5; ++i) 
//     {
//     blueTeam->push_back(new Robot());
//     yellowTeam->push_back(new Robot());
//     }
//   ball = new Ball();

}

void WorldModel::run()
{

  Q_FOREACH(const Packet::Vision& vision, _state->rawVision)
    {
      	if (!vision.sync)
	{
	  //index is the id
	  Q_FOREACH (const Packet::Vision::Robot& r, vision.blue)
	    {
	      _state->self[r.shell].shell = r.shell;
	      _state->self[r.shell].pos = r.pos;
	      _state->self[r.shell].angle = r.angle;
	      _state->self[r.shell].valid = true;
	    }
	  //index is the id
	  Q_FOREACH (const Packet::Vision::Robot& r, vision.yellow)
	    {
	      _state->opp[r.shell].shell = r.shell;
	      _state->opp[r.shell].pos = r.pos;
	      _state->opp[r.shell].angle = r.angle;
	      _state->opp[r.shell].valid = true;
	    }
	}
    }
}<commit_msg>Added passthrough for the ball<commit_after>#include "WorldModel.hpp"

#include <QObject>
#include <iostream>
#include <vector>

#include "Robot.hpp"
#include "Ball.hpp"

using namespace Modeling;

WorldModel::WorldModel() :
	Module("World Model")
{

//   blueTeam = new std::vector<Robot*>;
//   yellowTeam = new std::vector<Robot*>;
//   for (unsigned int i = 0; i<5; ++i) 
//     {
//     blueTeam->push_back(new Robot());
//     yellowTeam->push_back(new Robot());
//     }
//   ball = new Ball();

}

void WorldModel::run()
{

  Q_FOREACH(const Packet::Vision& vision, _state->rawVision)
    {
      	if (!vision.sync)
	{
	  //index is the id
	  Q_FOREACH (const Packet::Vision::Robot& r, vision.blue)
	    {
	      _state->self[r.shell].shell = r.shell;
	      _state->self[r.shell].pos = r.pos;
	      _state->self[r.shell].angle = r.angle;
	      _state->self[r.shell].valid = true;
	    }
	  //index is the id
	  Q_FOREACH (const Packet::Vision::Robot& r, vision.yellow)
	    {
	      _state->opp[r.shell].shell = r.shell;
	      _state->opp[r.shell].pos = r.pos;
	      _state->opp[r.shell].angle = r.angle;
	      _state->opp[r.shell].valid = true;
	    }
	  //copy ball
	  _state->ball.pos = vision.balls.at(1).pos;
	}
    }
}
{'fraction_non_alphanumeric': 0.18181818181818182, 'fraction_numerical': 0.002085070892410342, 'mean_word_length': 2.685099846390169, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3064884', 'n_tokens_mistral': 949, 'n_tokens_neox': 898, 'n_words': 168}