mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-28 20:44:34 +00:00
Core - Update AbstractModelContainer
This commit is contained in:
@@ -22,6 +22,7 @@ namespace PckStudio.Core.Model
|
||||
private IDictionary<string, AbstractModel> _models = new Dictionary<string, AbstractModel>();
|
||||
|
||||
public AbstractModel GetModelByName(string name) => _models[name];
|
||||
|
||||
public bool AddModel(AbstractModel model)
|
||||
{
|
||||
if (model == null || _models.ContainsKey(model.Name))
|
||||
@@ -32,7 +33,7 @@ namespace PckStudio.Core.Model
|
||||
|
||||
public bool RemoveModel(AbstractModel model) => model is not null && _models.Remove(model.Name);
|
||||
|
||||
public static AbstractModelContainer FromModelContainer(OMI.Formats.Model.ModelContainer models, ITryGet<string, Image> texture)
|
||||
public static AbstractModelContainer FromModelContainer(ModelContainer models, ITryGet<string, Image> texture)
|
||||
{
|
||||
var abstractModelContainer = new AbstractModelContainer();
|
||||
if (models is null)
|
||||
|
||||
@@ -24,6 +24,9 @@ namespace PckStudio.Core.Model
|
||||
_subParts = new List<AbstractModelPart>();
|
||||
}
|
||||
|
||||
public void AddBox(Vector3 position, Vector3 size, Vector2 uv, float inflate, bool mirror)
|
||||
=> AddBox(new Box(position, size, uv, inflate, mirror));
|
||||
|
||||
public void AddBox(Box box) => _boxes.Add(box);
|
||||
|
||||
internal void AddParts(IEnumerable<AbstractModelPart> parts) => _subParts.AddRange(parts);
|
||||
|
||||
Reference in New Issue
Block a user