Files
MinecraftConsoles/Minecraft.World/FoodData.h
void_17 7074f35e4b shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
2026-03-02 15:58:20 +07:00

34 lines
706 B
C++

#pragma once
class FoodItem;
class Player;
class CompoundTag;
class FoodData
{
private:
int foodLevel;
float saturationLevel;
float exhaustionLevel;
int tickTimer;
int lastFoodLevel;
public:
FoodData();
void eat(int food, float saturationModifier);
void eat(FoodItem *item);
void tick(std::shared_ptr<Player> player);
void readAdditionalSaveData(CompoundTag *entityTag);
void addAdditonalSaveData(CompoundTag *entityTag);
int getFoodLevel();
int getLastFoodLevel();
bool needsFood();
void addExhaustion(float amount);
float getExhaustionLevel();
float getSaturationLevel();
void setFoodLevel(int food);
void setSaturation(float saturation);
void setExhaustion(float exhaustion);
};