summaryrefslogtreecommitdiffstats
path: root/source/Minecart.h
blob: d46b80b3f375c91f6dea312b449c555a4e7f3c71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

// Minecart.h

// Declares the cMinecart class representing a minecart in the world





#pragma once

#include "Entity.h"





class cMinecart :
	public cEntity
{
	typedef cEntity super;
	
public:
	CLASS_PROTODEF(cMinecart);
	
	enum ePayload
	{
		mpNone,     // Empty minecart, ridable by player or mobs
		mpChest,    // Minecart-with-chest, can store a grid of 3*8 items
		mpFurnace,  // Minecart-with-furnace, can be powered
		// TODO: Other 1.5 features: hopper, tnt, dispenser, spawner
	} ;
	
	cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z);
	
	// cEntity overrides:
	virtual void Initialize(cWorld * a_World) override;
	virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
	virtual void Tick(float a_Dt, MTRand & a_TickRandom) override;
	
	ePayload GetPayload(void) const { return m_Payload; }
	
protected:
	ePayload m_Payload;
} ;