Add block provider interfaces
This commit is contained in:
parent
0f91a00326
commit
2b7d721326
12
TrueCraft.API/Logic/IBlockProvider.cs
Normal file
12
TrueCraft.API/Logic/IBlockProvider.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace TrueCraft.API.Logic
|
||||
{
|
||||
public interface IBlockProvider
|
||||
{
|
||||
byte ID { get; }
|
||||
double Hardness { get; }
|
||||
string DisplayName { get; }
|
||||
Tuple<int, int> TextureMap { get; }
|
||||
}
|
||||
}
|
9
TrueCraft.API/Logic/IItemProvider.cs
Normal file
9
TrueCraft.API/Logic/IItemProvider.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace TrueCraft.API.Logic
|
||||
{
|
||||
public interface IItemProvider
|
||||
{
|
||||
short ID { get; }
|
||||
}
|
||||
}
|
@ -69,6 +69,8 @@
|
||||
<Compile Include="Windows\IWindow.cs" />
|
||||
<Compile Include="Windows\IWindowArea.cs" />
|
||||
<Compile Include="Windows\WindowChangeEventArgs.cs" />
|
||||
<Compile Include="Logic\IBlockProvider.cs" />
|
||||
<Compile Include="Logic\IItemProvider.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
@ -78,6 +80,7 @@
|
||||
<Folder Include="Logging\" />
|
||||
<Folder Include="Entities\" />
|
||||
<Folder Include="Windows\" />
|
||||
<Folder Include="Logic\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\externals\fNbt\fNbt\fNbt.csproj">
|
||||
|
27
TrueCraft.Core/Logic/BlockProvider.cs
Normal file
27
TrueCraft.Core/Logic/BlockProvider.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using TrueCraft.API.Logic;
|
||||
|
||||
namespace TrueCraft.Core.Logic
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides common implementations of block logic.
|
||||
/// </summary>
|
||||
public abstract class BlockProvider : IBlockProvider, IItemProvider
|
||||
{
|
||||
short IItemProvider.ID
|
||||
{
|
||||
get
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract byte ID { get; }
|
||||
|
||||
public virtual double Hardness { get { return 0; } }
|
||||
|
||||
public virtual string DisplayName { get { return string.Empty; } }
|
||||
|
||||
public virtual Tuple<int, int> TextureMap { get { return null; } }
|
||||
}
|
||||
}
|
@ -109,6 +109,7 @@
|
||||
<Compile Include="Windows\CraftingWindowArea.cs" />
|
||||
<Compile Include="Windows\InventoryWindow.cs" />
|
||||
<Compile Include="Windows\WindowArea.cs" />
|
||||
<Compile Include="Logic\BlockProvider.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
@ -126,5 +127,7 @@
|
||||
<Folder Include="World\" />
|
||||
<Folder Include="Logging\" />
|
||||
<Folder Include="Windows\" />
|
||||
<Folder Include="Logic\" />
|
||||
<Folder Include="Logic\Blocks\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user