blob: 52db9f1134df5407161731811e9a23dbe75170e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "stdafx.h"
#include "net.minecraft.world.entity.player.h"
#include "HealthCriteria.h"
HealthCriteria::HealthCriteria(const wstring &id) : DummyCriteria(id)
{
}
int HealthCriteria::getScoreModifier(vector<shared_ptr<Player> > *players)
{
float health = 0;
for (AUTO_VAR(it,players->begin()); it != players->end(); ++it)
{
shared_ptr<Player> player = *it;
health += player->getHealth() + player->getAbsorptionAmount();
}
if (players->size() > 0) health /= players->size();
return Mth::ceil(health);
}
bool HealthCriteria::isReadOnly()
{
return true;
}
|