summaryrefslogtreecommitdiffstats
path: root/source/cTorch.h
diff options
context:
space:
mode:
authorcedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-14 15:06:06 +0200
committercedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-14 15:06:06 +0200
commit92c59963f82f81aa3202657e7fdbb2592924ede3 (patch)
treeb7eb2474528a4998fa102e3ec9119b908cee08b4 /source/cTorch.h
parentAdded HOOK_WEATHER_CHANGE. (diff)
downloadcuberite-92c59963f82f81aa3202657e7fdbb2592924ede3.tar
cuberite-92c59963f82f81aa3202657e7fdbb2592924ede3.tar.gz
cuberite-92c59963f82f81aa3202657e7fdbb2592924ede3.tar.bz2
cuberite-92c59963f82f81aa3202657e7fdbb2592924ede3.tar.lz
cuberite-92c59963f82f81aa3202657e7fdbb2592924ede3.tar.xz
cuberite-92c59963f82f81aa3202657e7fdbb2592924ede3.tar.zst
cuberite-92c59963f82f81aa3202657e7fdbb2592924ede3.zip
Diffstat (limited to 'source/cTorch.h')
-rw-r--r--source/cTorch.h186
1 files changed, 93 insertions, 93 deletions
diff --git a/source/cTorch.h b/source/cTorch.h
index 6bb2291b2..c45916dbf 100644
--- a/source/cTorch.h
+++ b/source/cTorch.h
@@ -1,94 +1,94 @@
-#pragma once
-
-#include "Vector3i.h"
-
-class cTorch //tolua_export
-{ //tolua_export
-public:
-
- static char DirectionToMetaData( char a_Direction ) //tolua_export
- { //tolua_export
- switch( a_Direction )
- {
- case 0x0:
- return 0x0;
- case 0x1:
- return 0x5; //standing on floor
- case 0x2:
- return 0x4; // south
- case 0x3:
- return 0x3; // north
- case 0x4:
- return 0x2; // west
- case 0x5:
- return 0x1; // east
- default:
- break;
- };
- return 0x0;
- } //tolua_export
-
- static char MetaDataToDirection( char a_MetaData ) //tolua_export
- { //tolua_export
- switch( a_MetaData )
- {
- case 0x0:
- return 0x0;
- case 0x1:
- return 0x5;
- case 0x2:
- return 0x4;
- case 0x3:
- return 0x3;
- case 0x4:
- return 0x2;
- case 0x5:
- return 0x1;
- default:
- break;
- };
- return 0x0;
- } //tolua_export
-
- static bool IsAttachedTo( const Vector3i & a_TorchPos, char a_TorchMeta, const Vector3i & a_BlockPos )
- {
- switch( a_TorchMeta )
- {
- case 0x0:
- case 0x5: // On floor
- if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 1, 0 ) ) )
- {
- return true;
- }
- break;
- case 0x4: // South -Z
- if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 0, -1 ) ) )
- {
- return true;
- }
- break;
- case 0x3: // North +Z
- if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 0, 1 ) ) )
- {
- return true;
- }
- break;
- case 0x2: // West -X
- if( (a_TorchPos - a_BlockPos).Equals( Vector3i(-1, 0, 0 ) ) )
- {
- return true;
- }
- break;
- case 0x1: // East +X
- if( (a_TorchPos - a_BlockPos).Equals( Vector3i( 1, 0, 0 ) ) )
- {
- return true;
- }
- break;
- default:
- break;
- };
- return false;
- }
-
+#pragma once
+
+#include "Vector3i.h"
+
+class cTorch //tolua_export
+{ //tolua_export
+public:
+
+ static char DirectionToMetaData( char a_Direction ) //tolua_export
+ { //tolua_export
+ switch( a_Direction )
+ {
+ case 0x0:
+ return 0x0;
+ case 0x1:
+ return 0x5; //standing on floor
+ case 0x2:
+ return 0x4; // south
+ case 0x3:
+ return 0x3; // north
+ case 0x4:
+ return 0x2; // west
+ case 0x5:
+ return 0x1; // east
+ default:
+ break;
+ };
+ return 0x0;
+ } //tolua_export
+
+ static char MetaDataToDirection( char a_MetaData ) //tolua_export
+ { //tolua_export
+ switch( a_MetaData )
+ {
+ case 0x0:
+ return 0x0;
+ case 0x1:
+ return 0x5;
+ case 0x2:
+ return 0x4;
+ case 0x3:
+ return 0x3;
+ case 0x4:
+ return 0x2;
+ case 0x5:
+ return 0x1;
+ default:
+ break;
+ };
+ return 0x0;
+ } //tolua_export
+
+ static bool IsAttachedTo( const Vector3i & a_TorchPos, char a_TorchMeta, const Vector3i & a_BlockPos )
+ {
+ switch( a_TorchMeta )
+ {
+ case 0x0:
+ case 0x5: // On floor
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 1, 0 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x4: // South -Z
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 0, -1 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x3: // North +Z
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 0, 1 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x2: // West -X
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(-1, 0, 0 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x1: // East +X
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i( 1, 0, 0 ) ) )
+ {
+ return true;
+ }
+ break;
+ default:
+ break;
+ };
+ return false;
+ }
+
}; //tolua_export \ No newline at end of file