the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 83 lines 1.9 kB view raw
1#pragma once 2using namespace std; 3 4#include "Entity.h" 5 6class Player; 7class Level; 8class CompoundTag; 9class DamageSource; 10 11class Boat : public Entity 12{ 13public: 14 eINSTANCEOF GetType() { return eTYPE_BOAT; }; 15 static Entity *create(Level *level) { return new Boat(level); } 16 17private: 18 // 4J - added for common ctor code 19 void _init(); 20public: 21 static const int serialVersionUID = 0; 22 23private: 24 static const int DATA_ID_HURT = 17; 25 static const int DATA_ID_HURTDIR = 18; 26 static const int DATA_ID_DAMAGE = 19; 27 static const double MAX_SPEED; 28 static const double MAX_COLLISION_SPEED; 29 static const double MIN_ACCELERATION; 30 static const double MAX_ACCELERATION; 31 32 bool doLerp; 33 double acceleration; 34 35public: 36 Boat(Level *level); 37 38protected: 39 virtual bool makeStepSound(); 40 virtual void defineSynchedData(); 41 42public: 43 virtual AABB *getCollideAgainstBox(shared_ptr<Entity> entity); 44 virtual AABB *getCollideBox(); 45 virtual bool isPushable(); 46 47 Boat(Level *level, double x, double y, double z); 48 49 virtual double getRideHeight(); 50 virtual bool hurt(DamageSource *source, float damage); 51 virtual void animateHurt(); 52 virtual bool isPickable(); 53 54private: 55 int lSteps; 56 double lx, ly, lz, lyr, lxr; 57 double lxd, lyd, lzd; 58 59public: 60 virtual void lerpTo(double x, double y, double z, float yRot, float xRot, int steps); 61 virtual void lerpMotion(double xd, double yd, double zd); 62 virtual void tick(); 63 virtual void positionRider(); 64 65protected: 66 virtual void addAdditonalSaveData(CompoundTag *base); 67 virtual void readAdditionalSaveData(CompoundTag *base); 68 69public: 70 virtual float getShadowHeightOffs(); 71 wstring getName(); 72 virtual bool interact(shared_ptr<Player> player); 73 74 virtual void setDamage(float damage); 75 virtual float getDamage(); 76 virtual void setHurtTime(int hurtTime); 77 virtual int getHurtTime(); 78 virtual void setHurtDir(int hurtDir); 79 virtual int getHurtDir(); 80 81 bool getDoLerp(); 82 void setDoLerp(bool doLerp); 83};