You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
693 B

/**
* @file player_test.h
*
* Helpers for player related tests.
*/
#pragma once
#include "items.h"
#include "player.h"
using namespace devilution;
static size_t CountItems(devilution::Item *items, int n)
{
return std::count_if(items, items + n, [](devilution::Item x) { return !x.isEmpty(); });
}
static size_t Count8(int8_t *ints, int n)
{
return std::count_if(ints, ints + n, [](int8_t x) { return x != 0; });
}
static size_t CountU8(uint8_t *ints, int n)
{
return std::count_if(ints, ints + n, [](uint8_t x) { return x != 0; });
}
static size_t CountBool(bool *bools, int n)
{
return std::count_if(bools, bools + n, [](bool x) { return x; });
}