using Gamecraft.Blocks.BlockGroups; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; namespace GamecraftModdingAPI { /// /// A group of blocks that can be selected together. The placed version of blueprints. /// public class BlockGroup { internal static BlueprintEngine _engine = new BlueprintEngine(); public int Id { get; } private Block _sourceBlock; internal BlockGroup(int id, Block block) { if (id == BlockGroupUtility.GROUP_UNASSIGNED) throw new BlockException("Cannot create a block group for blocks without a group!"); Id = id; _sourceBlock = block; } /// /// Collects each block that is a part of this group. /// /// An array of blocks public Block[] GetBlocks() { return _engine.GetBlocksFromGroup(_sourceBlock.Id); } /// /// Removes all of the blocks in this group from the world. /// public void Remove() { _engine.RemoveBlockGroup(Id); } public static void Init() { GameEngineManager.AddGameEngine(_engine); } } }