Files
Artemis/src/Artemis.Core/Models/Profile/LayerProperty.cs
T
Robert 59f0062c97 Added layer properties to core and hooked it up with the UI
Implemented timeline caret scrolling logic
Added special treeview style for the layer properties tree
2020-01-06 16:01:35 +01:00

49 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using Artemis.Core.Exceptions;
namespace Artemis.Core.Models.Profile
{
public class LayerProperty
{
private object _baseValue;
internal LayerProperty(Layer layer, LayerProperty parent, string name, string description, Type type)
{
Layer = layer;
Parent = parent;
Name = name;
Description = description;
Type = type;
Children = new List<LayerProperty>();
Keyframes = new List<Keyframe>();
}
public Layer Layer { get; }
public LayerProperty Parent { get; }
public List<LayerProperty> Children { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public Type Type { get; set; }
public object BaseValue
{
get => _baseValue;
set
{
if (value != null && value.GetType() != Type)
throw new ArtemisCoreException($"Cannot set value of type {value.GetType()} on property {Name}, expected type is {Type}.");
_baseValue = value;
}
}
public List<Keyframe> Keyframes { get; set; }
public void ApplyToEntity()
{
// Big o' TODO
}
}
}