aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Painting.h
blob: b47a012bb680ab0be85cbd91257c4a62add235cc (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#pragma once
using namespace std;

#include "Entity.h"
#include "HangingEntity.h"

class Level;
class CompoundTag;
class DamageSource;

class Painting : public HangingEntity
{

public:
	eINSTANCEOF GetType() { return eTYPE_PAINTING; }
	static Entity *create(Level *level) { return new Painting(level); }

private:
	//int checkInterval;

public:
	enum MotiveEnum {
		Kebab = 0, //
		Aztec, //
		Alban, //
		Aztec2, //
		Bomb, //
		Plant, //
		Wasteland, //

		Pool, //
		Courbet, //
		Sea, //
		Sunset, //
		Creebet, //

		Wanderer, //
		Graham, //

		Match, //
		Bust, //
		Stage, //
		Void, //
		SkullAndRoses, //
		Wither,
		Fighters, //

		Pointer, //
		Pigscene, //
		BurningSkull, //

		Skeleton, //
		DonkeyKong, //

		LAST_VALUE
	};

	// TODO 4J Replace the ENUM with static consts
	class Motive
	{
	public:
		static const Motive *values[];

		static const int MAX_MOTIVE_NAME_LENGTH;

		const wstring name;
		const int w, h;
		const int uo, vo;

	//private:
		Motive(wstring name, int w, int h, int uo, int vo) : name( name ), w( w ), h( h ), uo( uo ), vo( vo ) {};
	};

public:
	Motive *motive;

private:
	// 4J - added for common ctor code
	void _init( Level *level );

public:
	Painting(Level *level);
	Painting(Level *level, int xTile, int yTile, int zTile, int dir);
	Painting(Level *level, int x, int y, int z, int dir, wstring motiveName);

	// 4J Stu - Added this so that we can use some shared_ptr functions that were needed in the ctor
	// 4J Stu - Added motive param for debugging/artists only
	void PaintingPostConstructor(int dir, int motive = -1);

protected:
	//void defineSynchedData();

public:
	//void setDir(int dir);

private:
	//float offs(int w);

public:
	//virtual void tick();
	//bool survives();
	//virtual bool isPickable();
	//virtual bool hurt(DamageSource *source, int damage);
	virtual void addAdditonalSaveData(CompoundTag *tag);
	virtual void readAdditionalSaveData(CompoundTag *tag);
	//static Motive *randomMotive();

	//virtual void move(double xa, double ya, double za, bool noEntityCubes=false);	// 4J - added noEntityCubes parameter
	//virtual void push(double xa, double ya, double za);

	virtual int getWidth();
	virtual int getHeight();
	virtual void dropItem(shared_ptr<Entity> causedBy);
};