the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 65 lines 2.5 kB view raw
1#pragma once 2#include "Tile.h" 3#include "Definitions.h" 4 5class Player; 6class HitResult; 7class ChunkRebuildData; 8 9class DoorTile : public Tile 10{ 11 friend class Tile; 12 friend class ChunkRebuildData; 13 14private: 15 static const int TEXTURE_NORMAL = 0; 16 static const int TEXTURE_FLIPPED = 1; 17 18public: 19 static const int UPPER_BIT = 8; 20 static const int C_DIR_MASK = 3; 21 static const int C_OPEN_MASK = 4; 22 static const int C_LOWER_DATA_MASK = 7; 23 static const int C_IS_UPPER_MASK = 8; 24 static const int C_RIGHT_HINGE_MASK = 16; 25 26private: 27 static const int DOOR_TILE_TEXTURE_COUNT = 4; 28 static const wstring TEXTURES[]; 29 int texBase; 30 Icon *iconTop[2]; 31 Icon *iconBottom[2]; 32 33protected: 34 DoorTile(int id, Material *material); 35public: 36 virtual Icon *getTexture(int face, int data); 37 virtual Icon *getTexture(LevelSource *level, int x, int y, int z, int face); 38 virtual void registerIcons(IconRegister *iconRegister); 39 virtual bool blocksLight(); 40 virtual bool isSolidRender(bool isServerLevel = false); 41 virtual bool isCubeShaped(); 42 virtual int getRenderShape(); 43 virtual AABB *getTileAABB(Level *level, int x, int y, int z); 44 virtual AABB *getAABB(Level *level, int x, int y, int z); 45 virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()); // 4J added forceData, forceEntity param 46 int getDir(LevelSource *level, int x, int y, int z); 47 bool isOpen(LevelSource *level, int x, int y, int z); 48private: 49 using Tile::setShape; 50 virtual void setShape(int compositeData); 51public: 52 virtual void attack(Level *level, int x, int y, int z, shared_ptr<Player> player); 53 virtual bool TestUse(); 54 virtual bool use(Level *level, int x, int y, int z, shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param 55 void setOpen(Level *level, int x, int y, int z, bool shouldOpen); 56 virtual void neighborChanged(Level *level, int x, int y, int z, int type); 57 virtual int getResource(int data, Random *random, int playerBonusLevel); 58 virtual HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b); 59 virtual bool mayPlace(Level *level, int x, int y, int z); 60 static bool isOpen(int data); 61 virtual int getPistonPushReaction(); 62 int getCompositeData(LevelSource *level, int x, int y, int z); 63 virtual int cloneTileId(Level *level, int x, int y, int z); 64 virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr<Player> player); 65};