Move some files to more logical locations.

This commit is contained in:
UnknownShadow200 2016-08-19 15:39:47 +10:00
parent 90c7817b0c
commit ef37d78e48
4 changed files with 94 additions and 94 deletions

View File

@ -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
/// <summary> No special action is performed. </summary>
public const byte None = 0;
/// <summary> A specified action will be delayed for a certain time. </summary>
public const byte Wait = 1;
/// <summary> Reverts the block in the map back into the specified block id. </summary>
public const byte Revert = 2;
/// <summary> Randomly converts this physics item back into air. </summary>
public const byte Dissipate = 3;
/// <summary> Randomly causes this physics item to move down one block. </summary>
public const byte Drop = 4;
/// <summary> Randomly causes this physics item to create an explosion. </summary>
public const byte Explode = 5;
/// <summary> Causes this physics item to iterate through the 'rainbow' wool
/// block ids in either sequential or random order. </summary>
public const byte Rainbow = 6;
/// <summary> TNT block placed in tnt wars. </summary>
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
/// <summary> No special action is performed. </summary>
public const byte None = 0;
/// <summary> A specified action will be delayed for a certain time. </summary>
public const byte Wait = 1;
/// <summary> Reverts the block in the map back into the specified block id. </summary>
public const byte Revert = 2;
/// <summary> Randomly converts this physics item back into air. </summary>
public const byte Dissipate = 3;
/// <summary> Randomly causes this physics item to move down one block. </summary>
public const byte Drop = 4;
/// <summary> Randomly causes this physics item to create an explosion. </summary>
public const byte Explode = 5;
/// <summary> Causes this physics item to iterate through the 'rainbow' wool
/// block ids in either sequential or random order. </summary>
public const byte Rainbow = 6;
/// <summary> TNT block placed in tnt wars. </summary>
public const byte TntWars = 7;
}
}

View File

@ -486,10 +486,10 @@
<Compile Include="Generator\RealisticGenParams.cs" />
<Compile Include="Generator\RealisticMapGen.cs" />
<Compile Include="Generator\SimpleGen.cs" />
<Compile Include="Levels\fNbt.cs" />
<Compile Include="Levels\IO\CwFile.cs" />
<Compile Include="Levels\IO\DatFile.cs" />
<Compile Include="Levels\IO\FcmFile.cs" />
<Compile Include="Levels\IO\fNbt.cs" />
<Compile Include="Levels\IO\LvlFile.cs" />
<Compile Include="Levels\IO\LvlProperties.cs" />
<Compile Include="Levels\IO\McfFile.cs" />
@ -500,7 +500,6 @@
<Compile Include="Levels\LevelActions.cs" />
<Compile Include="Levels\LevelEnv.cs" />
<Compile Include="Levels\LevelInfo.cs" />
<Compile Include="Levels\PhysicsArgs.cs" />
<Compile Include="Levels\Physics\AIPhysics.cs" />
<Compile Include="Levels\Physics\AirPhysics.cs" />
<Compile Include="Levels\Physics\BirdPhysics.cs" />
@ -514,6 +513,7 @@
<Compile Include="Levels\Physics\HunterPhysics.cs" />
<Compile Include="Levels\Physics\LeafPhysics.cs" />
<Compile Include="Levels\Physics\LiquidPhysics.cs" />
<Compile Include="Levels\Physics\PhysicsArgs.cs" />
<Compile Include="Levels\Physics\SimpleLiquidPhysics.cs" />
<Compile Include="Levels\Physics\RocketPhysics.cs" />
<Compile Include="Levels\Physics\OtherPhysics.cs" />
@ -560,6 +560,7 @@
<Compile Include="Plugins\Plugin.cs" />
<Compile Include="Plugins\Plugin.Events.cs" />
<Compile Include="Plugins\PluginManager.cs" />
<Compile Include="Scripting\MCForgeScripter.cs" />
<Compile Include="Scripting\Scripting.cs" />
<Compile Include="Player\Ban.cs" />
<Compile Include="Levels\BlockDefinitions.cs" />
@ -623,7 +624,6 @@
<Compile Include="util\Extensions.cs" />
<Compile Include="util\Hasher.cs" />
<Compile Include="util\MathHelper.cs" />
<Compile Include="util\MCForgeScripter.cs" />
<Compile Include="Player\Player.CPE.cs" />
<Compile Include="Database\PlayerDB.cs" />
</ItemGroup>