Пример #1
0
bool MatchHelpers::attacksUp(const Team& t)
{
	auto mh = t.getMatch()->getMatchHalf();
	if(mh == MatchHalf::PenaltyShootout) {
		return t.isFirst() == t.getMatch()->getPenaltyShootout().firstTeamKicksNext();
	}

	return t.isFirst() == (mh <= MatchHalf::FirstHalf ||
		(mh <= MatchHalf::ExtraTimeFirstHalf &&
		mh >= MatchHalf::FullTimePauseEnd));
}
Пример #2
0
Vector3 MatchHelpers::ownGoalPosition(const Team& t)
{
	const Match* m = t.getMatch();
	assert(m);
	if(attacksUp(t)) {
		return m->convertRelativeToAbsoluteVector(RelVector3(Vector3(0, -1, 0)));
	}
	else {
		return m->convertRelativeToAbsoluteVector(RelVector3(Vector3(0, 1, 0)));
	}
}