using System;
using DataLoader;
namespace GamecraftModdingAPI.Blocks
{
[AttributeUsage(AttributeTargets.Class)]
public class CustomBlockAttribute : Attribute
{
///
/// Custom block attribute necessary for configuration.
///
/// File path to the catalog.json that holds asset references for the custom block
/// The path/address to the block's prefab specified in Unity
/// The translation key for the block's name
/// The path to the inventory sprite for the block, console block by default
/// The translation key for the block's description
public CustomBlockAttribute(string catalog, string assetPath, string nameKey,
string spriteName = "CTR_CommandBlock", string descKey = "")
{
Catalog = catalog;
AssetPath = assetPath;
SpriteName = spriteName;
NameKey = nameKey;
DescKey = descKey;
}
///
/// The location of the catalog.json file used to find assets for this block.
///
public string Catalog { get; }
///
/// The asset path/address for the block's prefab.
///
public string AssetPath { get; }
///
/// The name of the sprite used in the inventory.
///
public string SpriteName { get; }
///
/// The translation key for the block's name.
///
public string NameKey { get; }
///
/// The translation key for the block's description.
///
public string DescKey { get; }
///
/// The block's type - block, joint, light.
///
public CubeType Type { get; set; } = CubeType.Block;
///
/// The block's category, so it's treated as a pre-existing functional block.
///
public CubeCategory Category { get; set; } = CubeCategory.General;
///
/// The block's inventory category.
///
public InventoryCategory InventoryCategory { get; set; } = InventoryCategory.Shapes;
///
/// The block's mass.
///
public float Mass { get; set; } = 1f;
///
/// The key of the material properties this block should use.
///
public string Material { get; set; } = "Aluminium";
///
/// The scaling permission determining what scaling is allowed on this block.
///
public ScalingPermission ScalingPermission { get; set; }
///
/// The sort index in the inventory.
///
public int SortIndex { get; set; }
///
/// The default color of the block when placed.
///
public BlockColor DefaultColor { get; set; }
///
/// The volume of the block.
///
public float Volume { get; set; } = 1f;
}
}