summaryrefslogtreecommitdiffstats
path: root/src/UI/MinecartWithChestWindow.h
blob: bf136a43d10c3c4ff04b3d45a98ce3eb4018ae2d (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

// MinecartWithChestWindow.h

// Representing the UI window for the minecart chest entity





#pragma once

#include "Window.h"
#include "../Entities/Minecart.h"





class cMinecartWithChestWindow :
	public cWindow
{
	typedef cWindow super;

public:
	cMinecartWithChestWindow(cMinecartWithChest * a_ChestCart) :
		cWindow(wtChest, "Minecart with Chest"),
		m_ChestCart(a_ChestCart)
	{
		m_ShouldDistributeToHotbarFirst = false;
		m_SlotAreas.push_back(new cSlotAreaMinecartWithChest(a_ChestCart, *this));
		m_SlotAreas.push_back(new cSlotAreaInventory(*this));
		m_SlotAreas.push_back(new cSlotAreaHotBar(*this));

		a_ChestCart->GetWorld()->BroadcastSoundEffect("random.chestopen", a_ChestCart->GetPosX(), a_ChestCart->GetPosY(), a_ChestCart->GetPosZ(), 1, 1);
	}

	~cMinecartWithChestWindow()
	{
		m_ChestCart->GetWorld()->BroadcastSoundEffect("random.chestclosed", m_ChestCart->GetPosX(), m_ChestCart->GetPosY(), m_ChestCart->GetPosZ(), 1, 1);
	}

private:
	cMinecartWithChest * m_ChestCart;
};