Exemplo n.º 1
0
	MLFixture()
	{
		va = map_location(3,4);
		vb = map_location(10,8);
		vc = map_location(0,9);
		vz = map_location::ZERO();
		vt1 = va.vector_negation();
		vt2 = vb.vector_sum(vc);
		vt3 = va.vector_sum(vc.vector_negation());

		vs1 = vz.get_direction(nw);
		vs2 = vz.get_direction(n).get_direction(ne);
		vs3 = vz.get_direction(s).get_direction(se);
		vs4 = vz.get_direction(sw).get_direction(se);

		preset_locs.push_back(va);
		preset_locs.push_back(vb);
		preset_locs.push_back(vc);
		preset_locs.push_back(vz);
		preset_locs.push_back(vt1);
		preset_locs.push_back(vt2);
		preset_locs.push_back(vt3);
		preset_locs.push_back(vs1);
		preset_locs.push_back(vs2);
		preset_locs.push_back(vs3);
		preset_locs.push_back(vs4);
	}
Exemplo n.º 2
0
static void reality_check_get_direction_helper(const map_location & loc, const map_location::DIRECTION d)
{
	map_location lz(vz.get_direction(d));

	map_location temp(loc.vector_sum(lz));
	BOOST_CHECK_EQUAL(temp, loc.get_direction(d));
	BOOST_CHECK(tiles_adjacent(loc,temp));
	BOOST_CHECK(tiles_adjacent(temp,loc));
	BOOST_CHECK_EQUAL(distance_between(loc,temp), 1);
}