public BBCtrl(string c1, string c2, string tb, BuildingBlock b, NBT Nbt) { InitializeComponent(); t1.Text = tb; var converter = TypeDescriptor.GetConverter(typeof(Geometry)); p1.Data = (Geometry)converter.ConvertFrom(c1); p2.Data = GetReverse((Geometry)converter.ConvertFrom(c2)); bb = b; Panel.SetZIndex(this, 1); }
/// <summary> /// 以绑定的NBT初始化 /// </summary> /// <param name="buildingBlocks"></param> /// <param name="Head"></param> /// <param name="tail"></param> /// <param name="Nbt"></param> public BuildingBlock(BuildingBlockGroup buildingBlocks, BBShapes Head, BBShapes tail, NBT Nbt) { Position = buildingBlocks.Position; //TODO 改 size = pv.building_block_size; Father_Node = (buildingBlocks.buildingBlocks.Count >= 1 ? buildingBlocks.buildingBlocks[buildingBlocks.buildingBlocks.Count - 1] : null); Child_Node = null; depth = buildingBlocks.buildingBlocks.Count; if (depth == 1) { IsHead = true; } else { IsHead = false; } BuildingBlockGroup = buildingBlocks; HeadShape = Head; TailShape = tail; g = buildingBlocks.Holder; buildingBlocks.buildingBlocks.Add(this); BindingNBT = Nbt; }