void Animal::EatGrass() { for (int x=X()-1; x<=X()+1; ++x) for (int y=Y()-1; y<=Y()+1; ++y) { if ( world->InBounds(x, y) && GREENERY == world->GetBlock(x, y, Z())->Sub() ) { TryDestroy(x, y, Z()); Eat(GREENERY); return; } } }
void Active::DamageAround() const { const AroundCoordinates arounds(X(), Y(), Z()); for (const XyzInt& xyz : arounds) { TryDestroy(XYZ(xyz)); } }