the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 92 lines 2.0 kB view raw
1#pragma once 2#include "MaterialColor.h" 3 4class ChunkRebuildData; 5 6class Material 7{ 8 friend class ChunkRebuildData; 9public: 10 static Material *air; 11 static Material *grass; 12 static Material *dirt; 13 static Material *wood; 14 static Material *stone; 15 static Material *metal; 16 static Material *heavyMetal; 17 static Material *water; 18 static Material *lava; 19 static Material *leaves; 20 static Material *plant; 21 static Material *replaceable_plant; 22 static Material *sponge; 23 static Material *cloth; 24 static Material *fire; 25 static Material *sand; 26 static Material *decoration; 27 static Material *clothDecoration; 28 static Material *glass; 29 static Material *buildable_glass; 30 static Material *explosive; 31 static Material *coral; 32 static Material *ice; 33 static Material *topSnow; 34 static Material *snow; 35 static Material *cactus; 36 static Material *clay; 37 static Material *vegetable; 38 static Material *egg; 39 static Material *portal; 40 static Material *cake; 41 static Material *web; 42 static Material *piston; 43 44 static const int PUSH_NORMAL = 0; 45 static const int PUSH_DESTROY = 1; 46 static const int PUSH_BLOCK = 2; // not pushable 47 48 static void staticCtor(); 49 50private: 51 bool _flammable, _replaceable, _neverBuildable; 52 53public: 54 MaterialColor *color; 55private: 56 bool _isAlwaysDestroyable; 57 int pushReaction; 58 bool destroyedByHand; 59public: 60 61 Material(MaterialColor *color); 62 virtual bool isLiquid() ; 63 virtual bool letsWaterThrough(); 64 virtual bool isSolid(); 65 virtual bool blocksLight(); 66 virtual bool blocksMotion(); 67 68private: 69 virtual Material *neverBuildable(); 70protected: 71 virtual Material *notAlwaysDestroyable(); 72 virtual Material *flammable(); 73 74public: 75 virtual bool isFlammable(); 76 virtual Material *replaceable(); 77 virtual bool isReplaceable(); 78 virtual bool isSolidBlocking(); 79 virtual bool isAlwaysDestroyable(); 80 virtual int getPushReaction(); 81 82protected: 83 Material *makeDestroyedByHand(); 84 85public: 86 bool isDestroyedByHand(); 87 88protected: 89 Material *destroyOnPush(); 90 Material *notPushable(); 91}; 92