1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef GAME_CLIENT_COMPONENTS_ITEMS_H
4#define GAME_CLIENT_COMPONENTS_ITEMS_H
5#include <game/client/component.h>
6#include <game/generated/protocol.h>
7
8class CProjectileData;
9class CLaserData;
10
11class CItems : public CComponent
12{
13 void RenderProjectile(const CProjectileData *pCurrent, int ItemId);
14 void RenderPickup(const CNetObj_Pickup *pPrev, const CNetObj_Pickup *pCurrent, bool IsPredicted = false);
15 void RenderFlag(const CNetObj_Flag *pPrev, const CNetObj_Flag *pCurrent, const CNetObj_GameData *pPrevGameData, const CNetObj_GameData *pCurGameData);
16 void RenderLaser(const CLaserData *pCurrent, bool IsPredicted = false);
17
18 int m_ItemsQuadContainerIndex;
19
20public:
21 virtual int Sizeof() const override { return sizeof(*this); }
22 virtual void OnRender() override;
23 virtual void OnInit() override;
24
25 void ReconstructSmokeTrail(const CProjectileData *pCurrent, int DestroyTick);
26
27private:
28 int m_BlueFlagOffset;
29 int m_RedFlagOffset;
30 int m_PickupHealthOffset;
31 int m_PickupArmorOffset;
32 int m_aPickupWeaponOffset[NUM_WEAPONS];
33 int m_PickupNinjaOffset;
34 int m_aPickupWeaponArmorOffset[4];
35 int m_aProjectileOffset[NUM_WEAPONS];
36 int m_aParticleSplatOffset[3];
37};
38
39#endif
40