<commit_before>#include "LineUp.hpp"

#include <algorithm>

using namespace std;

REGISTER_PLAY_CATEGORY(Gameplay::Plays::LineUp, "Demos")

static bool shellLessThan(Robot *r1, Robot *r2)
{
	return r1->shell() < r2->shell();
}

Gameplay::Plays::LineUp::LineUp(GameplayModule* gameplay):
	Play(gameplay)
{
}

float Gameplay::Plays::LineUp::score(GameplayModule* gameplay)
{
	return 0;
}

bool Gameplay::Plays::LineUp::run()
{
	const set<OurRobot *> &playRobots = _gameplay->playRobots();
	if (playRobots.empty())
	{
		// No robots
		return false;
	}
	
	// Make a list of robots, sorted by shell
	vector<OurRobot *> robots(playRobots.size());
	copy(playRobots.begin(), playRobots.end(), robots.begin());
	sort(robots.begin(), robots.end(), shellLessThan);
	
	for (unsigned int i = 0; i < robots.size(); ++i)
	{
		Geometry2d::Point dest = Geometry2d::Point(-1.9 + i * 0.28, 0.2);
		robots[i]->move(dest);
		robots[i]->face(dest + Geometry2d::Point(0, 1));
	}
	
	return true;
}<commit_msg>Changed LineUp play to lineup along side, not back of field<commit_after>#include "LineUp.hpp"

#include <algorithm>

using namespace std;

REGISTER_PLAY_CATEGORY(Gameplay::Plays::LineUp, "Demos")

static bool shellLessThan(Robot *r1, Robot *r2)
{
	return r1->shell() < r2->shell();
}

Gameplay::Plays::LineUp::LineUp(GameplayModule* gameplay):
	Play(gameplay)
{
}

float Gameplay::Plays::LineUp::score(GameplayModule* gameplay)
{
	return 0;
}

bool Gameplay::Plays::LineUp::run()
{
	const set<OurRobot *> &playRobots = _gameplay->playRobots();
	if (playRobots.empty())
	{
		// No robots
		return false;
	}
	
	// Make a list of robots, sorted by shell
	vector<OurRobot *> robots(playRobots.size());
	copy(playRobots.begin(), playRobots.end(), robots.begin());
	sort(robots.begin(), robots.end(), shellLessThan);
	
	for (unsigned int i = 0; i < robots.size(); ++i)
	{
		Geometry2d::Point dest = Geometry2d::Point(-1.9, 0.2 + i * 0.32);
		robots[i]->move(dest);
		robots[i]->face(dest + Geometry2d::Point(0, 1));
	}
	
	return true;
}
{'fraction_non_alphanumeric': 0.17807539682539683, 'fraction_numerical': 0.017857142857142856, 'mean_word_length': 5.206153846153846, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '2483549', 'n_tokens_mistral': 820, 'n_tokens_neox': 763, 'n_words': 158}