summaryrefslogtreecommitdiffstats
path: root/src/Entities/Minecart.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-09-29 14:59:24 +0200
committerGitHub <noreply@github.com>2019-09-29 14:59:24 +0200
commit365cbc6e1cea96741e26c9ce912b003f8fd2c62c (patch)
treef23682c47928597791c53f3a300b03494ffde417 /src/Entities/Minecart.h
parentCactus can now grow and will be dropped if there is no place to grow. (diff)
downloadcuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.gz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.bz2
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.lz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.xz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.zst
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.zip
Diffstat (limited to 'src/Entities/Minecart.h')
-rw-r--r--src/Entities/Minecart.h35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/Entities/Minecart.h b/src/Entities/Minecart.h
index ef5b9e030..79624494c 100644
--- a/src/Entities/Minecart.h
+++ b/src/Entities/Minecart.h
@@ -20,7 +20,7 @@
class cMinecart :
public cEntity
{
- typedef cEntity super;
+ using super = cEntity;
public:
CLASS_PROTODEF(cMinecart)
@@ -45,7 +45,9 @@ public:
int LastDamage(void) const { return m_LastDamage; }
ePayload GetPayload(void) const { return m_Payload; }
+
protected:
+
ePayload m_Payload;
int m_LastDamage;
Vector3i m_DetectorRailPosition;
@@ -57,7 +59,7 @@ protected:
// Overwrite to enforce speed limit
virtual void DoSetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ) override;
- cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z);
+ cMinecart(ePayload a_Payload, Vector3d a_Pos);
/** Handles physics on normal rails
For each tick, slow down on flat rails, speed up or slow down on ascending / descending rails (depending on direction), and turn on curved rails. */
@@ -95,19 +97,23 @@ protected:
class cRideableMinecart :
public cMinecart
{
- typedef cMinecart super;
+ using super = cMinecart;
public:
+
CLASS_PROTODEF(cRideableMinecart)
- cRideableMinecart(double a_X, double a_Y, double a_Z, const cItem & a_Content, int a_Height);
+ cRideableMinecart(Vector3d a_Pos, const cItem & a_Content, int a_Height);
const cItem & GetContent(void) const {return m_Content;}
int GetBlockHeight(void) const {return m_Height;}
+
// cEntity overrides:
virtual void OnRightClicked(cPlayer & a_Player) override;
+
protected:
+
cItem m_Content;
int m_Height;
} ;
@@ -121,12 +127,13 @@ class cMinecartWithChest :
public cItemGrid::cListener,
public cEntityWindowOwner
{
- typedef cMinecart super;
+ using super = cMinecart;
public:
+
CLASS_PROTODEF(cMinecartWithChest)
- cMinecartWithChest(double a_X, double a_Y, double a_Z);
+ cMinecartWithChest(Vector3d a_Pos);
enum
{
@@ -137,7 +144,9 @@ public:
const cItem & GetSlot(int a_Idx) const { return m_Contents.GetSlot(a_Idx); }
void SetSlot(int a_Idx, const cItem & a_Item) { m_Contents.SetSlot(a_Idx, a_Item); }
+
protected:
+
cItemGrid m_Contents;
void OpenNewWindow(void);
virtual void Destroyed() override;
@@ -169,12 +178,13 @@ protected:
class cMinecartWithFurnace :
public cMinecart
{
- typedef cMinecart super;
+ using super = cMinecart;
public:
+
CLASS_PROTODEF(cMinecartWithFurnace)
- cMinecartWithFurnace(double a_X, double a_Y, double a_Z);
+ cMinecartWithFurnace(Vector3d a_Pos);
// cEntity overrides:
virtual void OnRightClicked(cPlayer & a_Player) override;
@@ -201,12 +211,12 @@ private:
class cMinecartWithTNT :
public cMinecart
{
- typedef cMinecart super;
+ using super = cMinecart;
public:
CLASS_PROTODEF(cMinecartWithTNT)
- cMinecartWithTNT(double a_X, double a_Y, double a_Z);
+ cMinecartWithTNT(Vector3d a_Pos);
} ;
@@ -216,10 +226,11 @@ public:
class cMinecartWithHopper :
public cMinecart
{
- typedef cMinecart super;
+ using super = cMinecart;
public:
+
CLASS_PROTODEF(cMinecartWithHopper)
- cMinecartWithHopper(double a_X, double a_Y, double a_Z);
+ cMinecartWithHopper(Vector3d a_Pos);
} ;