diff --git a/Levels/fNbt.cs b/Levels/IO/fNbt.cs similarity index 100% rename from Levels/fNbt.cs rename to Levels/IO/fNbt.cs diff --git a/Levels/PhysicsArgs.cs b/Levels/Physics/PhysicsArgs.cs similarity index 97% rename from Levels/PhysicsArgs.cs rename to Levels/Physics/PhysicsArgs.cs index 8a01ca000..0a04a38f8 100644 --- a/Levels/PhysicsArgs.cs +++ b/Levels/Physics/PhysicsArgs.cs @@ -1,92 +1,92 @@ -/* - Copyright 2015 MCGalaxy - - Dual-licensed under the Educational Community License, Version 2.0 and - the GNU General Public License, Version 3 (the "Licenses"); you may - not use this file except in compliance with the Licenses. You may - obtain a copy of the Licenses at - - http://www.opensource.org/licenses/ecl2.php - http://www.gnu.org/licenses/gpl-3.0.html - - Unless required by applicable law or agreed to in writing, - software distributed under the Licenses are distributed on an "AS IS" - BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the Licenses for the specific language governing - permissions and limitations under the Licenses. - */ -using System; -using System.Runtime.InteropServices; - -namespace MCGalaxy.BlockPhysics { - - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct PhysicsArgs { - public uint Raw; - - public const uint TypeMask = 0x3F; - - public byte Type1 { - get { return (byte)(Raw & 0x7); } - set { Raw &= ~(0x7u << 0); - Raw |= (uint)value << 0; } - } - - public byte Type2 { - get { return (byte)((Raw >> 3) & 0x7); } - set { Raw &= ~(0x7u << 3); - Raw |= (uint)value << 3; } - } - - public byte Value1 { - get { return (byte)(Raw >> 6); } - set { Raw &= ~(0xFFu << 6); - Raw |= (uint)value << 6; } - } - - public byte Value2 { - get { return (byte)(Raw >> 14); } - set { Raw &= ~(0xFFu << 14); - Raw |= (uint)value << 14; } - } - - public byte Data { - get { return (byte)(Raw >> 22); } - set { Raw &= ~(0xFFu << 22); - Raw |= (uint)value << 22; } - } - - public bool Door { - get { return (Raw & (1u << 30)) != 0; } - set { Raw &= ~(1u << 30); - Raw |= (value ? 1u : 0u) << 30; } - } - - public bool HasWait { - get { byte value = (byte)Raw; - return (value & 0x7) == Wait || ((value & 0x38) == Wait << 3); - } - } - - public void ResetTypes() { Raw &= ~TypeMask; } - // TODO: what to do with last bit - - /// No special action is performed. - public const byte None = 0; - /// A specified action will be delayed for a certain time. - public const byte Wait = 1; - /// Reverts the block in the map back into the specified block id. - public const byte Revert = 2; - /// Randomly converts this physics item back into air. - public const byte Dissipate = 3; - /// Randomly causes this physics item to move down one block. - public const byte Drop = 4; - /// Randomly causes this physics item to create an explosion. - public const byte Explode = 5; - /// Causes this physics item to iterate through the 'rainbow' wool - /// block ids in either sequential or random order. - public const byte Rainbow = 6; - /// TNT block placed in tnt wars. - public const byte TntWars = 7; - } +/* + Copyright 2015 MCGalaxy + + Dual-licensed under the Educational Community License, Version 2.0 and + the GNU General Public License, Version 3 (the "Licenses"); you may + not use this file except in compliance with the Licenses. You may + obtain a copy of the Licenses at + + http://www.opensource.org/licenses/ecl2.php + http://www.gnu.org/licenses/gpl-3.0.html + + Unless required by applicable law or agreed to in writing, + software distributed under the Licenses are distributed on an "AS IS" + BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the Licenses for the specific language governing + permissions and limitations under the Licenses. + */ +using System; +using System.Runtime.InteropServices; + +namespace MCGalaxy.BlockPhysics { + + [StructLayout(LayoutKind.Sequential, Pack = 4)] + public struct PhysicsArgs { + public uint Raw; + + public const uint TypeMask = 0x3F; + + public byte Type1 { + get { return (byte)(Raw & 0x7); } + set { Raw &= ~(0x7u << 0); + Raw |= (uint)value << 0; } + } + + public byte Type2 { + get { return (byte)((Raw >> 3) & 0x7); } + set { Raw &= ~(0x7u << 3); + Raw |= (uint)value << 3; } + } + + public byte Value1 { + get { return (byte)(Raw >> 6); } + set { Raw &= ~(0xFFu << 6); + Raw |= (uint)value << 6; } + } + + public byte Value2 { + get { return (byte)(Raw >> 14); } + set { Raw &= ~(0xFFu << 14); + Raw |= (uint)value << 14; } + } + + public byte Data { + get { return (byte)(Raw >> 22); } + set { Raw &= ~(0xFFu << 22); + Raw |= (uint)value << 22; } + } + + public bool Door { + get { return (Raw & (1u << 30)) != 0; } + set { Raw &= ~(1u << 30); + Raw |= (value ? 1u : 0u) << 30; } + } + + public bool HasWait { + get { byte value = (byte)Raw; + return (value & 0x7) == Wait || ((value & 0x38) == Wait << 3); + } + } + + public void ResetTypes() { Raw &= ~TypeMask; } + // TODO: what to do with last bit + + /// No special action is performed. + public const byte None = 0; + /// A specified action will be delayed for a certain time. + public const byte Wait = 1; + /// Reverts the block in the map back into the specified block id. + public const byte Revert = 2; + /// Randomly converts this physics item back into air. + public const byte Dissipate = 3; + /// Randomly causes this physics item to move down one block. + public const byte Drop = 4; + /// Randomly causes this physics item to create an explosion. + public const byte Explode = 5; + /// Causes this physics item to iterate through the 'rainbow' wool + /// block ids in either sequential or random order. + public const byte Rainbow = 6; + /// TNT block placed in tnt wars. + public const byte TntWars = 7; + } } \ No newline at end of file diff --git a/MCGalaxy_.csproj b/MCGalaxy_.csproj index bbcc07f1d..add92aea1 100644 --- a/MCGalaxy_.csproj +++ b/MCGalaxy_.csproj @@ -486,10 +486,10 @@ - + @@ -500,7 +500,6 @@ - @@ -514,6 +513,7 @@ + @@ -560,6 +560,7 @@ + @@ -623,7 +624,6 @@ - diff --git a/util/MCForgeScripter.cs b/Scripting/MCForgeScripter.cs similarity index 100% rename from util/MCForgeScripter.cs rename to Scripting/MCForgeScripter.cs