Files
MinecraftConsoles/Minecraft.World/Pig.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

59 lines
1.3 KiB
C++

#pragma once
using namespace std;
#include "Animal.h"
class Player;
class LightningBolt;
class ControlledByPlayerGoal;
class Pig : public Animal
{
public:
eINSTANCEOF GetType() { return eTYPE_PIG; }
static Entity *create(Level *level) { return new Pig(level); }
private:
static const int DATA_SADDLE_ID = 16;
ControlledByPlayerGoal *controlGoal;
public:
Pig(Level *level);
virtual bool useNewAi();
virtual int getMaxHealth();
virtual bool canBeControlledByRider();
protected:
virtual void defineSynchedData();
public:
virtual void addAdditonalSaveData(CompoundTag *tag);
virtual void readAdditionalSaveData(CompoundTag *tag);
protected:
virtual int getAmbientSound();
virtual int getHurtSound();
virtual int getDeathSound();
public:
virtual bool interact(std::shared_ptr<Player> player);
protected:
virtual int getDeathLoot();
virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
public:
bool hasSaddle();
void setSaddle(bool value);
virtual void thunderHit(const LightningBolt *lightningBolt);
protected:
virtual void causeFallDamage(float distance);
public:
virtual std::shared_ptr<AgableMob> getBreedOffspring(std::shared_ptr<AgableMob> target);
bool isFood(std::shared_ptr<ItemInstance> itemInstance);
ControlledByPlayerGoal *getControlGoal();
};