mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-23 00:54:50 +00:00
Core - Add AbstractModel.cs, AbstractModelContainer.cs & AbstractModelPart.cs
This commit is contained in:
31
PckStudio.Core/Model/AbstractModelPart.cs
Normal file
31
PckStudio.Core/Model/AbstractModelPart.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
|
||||
namespace PckStudio.Core.Model
|
||||
{
|
||||
public class AbstractModelPart
|
||||
{
|
||||
public string Name { get; }
|
||||
public AbstractModelPart Parent { get; }
|
||||
public Vector3 Translation { get; }
|
||||
public Vector3 Rotation { get; }
|
||||
|
||||
private IList<Box> _boxes;
|
||||
private List<AbstractModelPart> _subParts;
|
||||
|
||||
public AbstractModelPart(string name, AbstractModelPart parent, Vector3 translation, Vector3 rotation, IEnumerable<Box> boxes)
|
||||
{
|
||||
Name = name;
|
||||
Parent = parent;
|
||||
Translation = translation;
|
||||
Rotation = rotation;
|
||||
_boxes = new List<Box>(boxes);
|
||||
_subParts = new List<AbstractModelPart>();
|
||||
}
|
||||
|
||||
public void AddBox(Box box) => _boxes.Add(box);
|
||||
|
||||
internal void AddParts(IEnumerable<AbstractModelPart> parts) => _subParts.AddRange(parts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user