Created
November 6, 2011 05:05
-
-
Save Darthfett/1342503 to your computer and use it in GitHub Desktop.
Lever Metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Methods of Dealing with Metadata (such as whether a lever is turned on or off (powered or unpowered) | |
// 1: | |
mf.Metadata.Levers = { | |
"SideEastOff": 1, | |
"SideWestOff": 2, | |
"SideSouthOff": 3, | |
"SideNorthOff": 4, | |
"TopNorthOff": 5, | |
"TopEastOff": 6, | |
"SideEastOn": 9, | |
"SideWestOn": 10, | |
"SideSouthOn": 11, | |
"SideNorthOn": 12, | |
"TopNorthOn": 13, | |
"TopEastOn": 14 | |
}; | |
// And a metadata library makes further usable functions | |
// 2: | |
var block = mf.BlockAt(...); | |
if (block.isPowered()) { ... } | |
// Also to consider: | |
var powered = block.isPowered(); | |
// powered is "undefined" if the type of block is not powerable, OR | |
// isPowered is "undefined" if the type of block is not powerable | |
// 3: | |
var block = mf.BlockAt(...); | |
if (mf.Metadata.isPowered(block1)) { ... } | |
// Also to consider: | |
var powered = mf.Metadata.isPowered(block2) | |
// powered is "undefined" if the type is not powerable, OR | |
// a block passed to isPowered is asserted to be of a 'powerable' type. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment