Class ProfileElement
Represents an element of a Profile
Inherited Members
Namespace: Artemis.Core
Assembly: Artemis.Core.dll
Syntax
public abstract class ProfileElement : BreakableModel, IBreakableModel, IDisposable
Properties
BrokenDisplayName
Gets the display name of this breakable model
Declaration
public override string BrokenDisplayName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Children
The element's children
Declaration
public ReadOnlyCollection<ProfileElement> Children { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<ProfileElement> |
Disposed
Gets a boolean indicating whether the profile element is disposed
Declaration
public bool Disposed { get; protected set; }
Property Value
Type | Description |
---|---|
bool |
EntityId
Gets the unique ID of this profile element
Declaration
public Guid EntityId { get; }
Property Value
Type | Description |
---|---|
Guid |
Name
The name which appears in the editor
Declaration
public string? Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Order
The order in which this element appears in the update loop and editor
Declaration
public int Order { get; }
Property Value
Type | Description |
---|---|
int |
Parent
Gets the parent of this element
Declaration
public ProfileElement? Parent { get; }
Property Value
Type | Description |
---|---|
ProfileElement |
Profile
Gets the profile this element belongs to
Declaration
public Profile Profile { get; }
Property Value
Type | Description |
---|---|
Profile |
Suspended
Gets or sets the suspended state, if suspended the element is skipped in render and update
Declaration
public bool Suspended { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddChild(ProfileElement, int?)
Adds a profile element to the Children collection, optionally at the given position (0-based)
Declaration
public virtual void AddChild(ProfileElement child, int? order = null)
Parameters
Type | Name | Description |
---|---|---|
ProfileElement | child | The profile element to add |
int? | order | The order where to place the child (0-based), defaults to the end of the collection |
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Disposes the profile element
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
GetAllFolders()
Returns a flattened list of all child folders
Declaration
public List<Folder> GetAllFolders()
Returns
Type | Description |
---|---|
List<Folder> |
GetAllLayers()
Returns a flattened list of all child layers
Declaration
public List<Layer> GetAllLayers()
Returns
Type | Description |
---|---|
List<Layer> |
GetAllRenderElements()
Returns a flattened list of all child render elements
Declaration
public List<RenderProfileElement> GetAllRenderElements()
Returns
Type | Description |
---|---|
List<RenderProfileElement> |
GetNewFolderName(string)
Returns a name for a new folder according to any other folders with a default name similar to creating new folders in Explorer
Declaration
public string GetNewFolderName(string baseName = "New folder")
Parameters
Type | Name | Description |
---|---|---|
string | baseName |
Returns
Type | Description |
---|---|
string | The resulting name i.e. |
GetNewLayerName(string)
Returns a name for a new layer according to any other layers with a default name similar to creating new folders in Explorer
Declaration
public string GetNewLayerName(string baseName = "New layer")
Parameters
Type | Name | Description |
---|---|---|
string | baseName |
Returns
Type | Description |
---|---|
string | The resulting name i.e. |
OnChildAdded(ProfileElement)
Invokes the ChildAdded event
Declaration
protected virtual void OnChildAdded(ProfileElement child)
Parameters
Type | Name | Description |
---|---|---|
ProfileElement | child |
OnChildRemoved(ProfileElement)
Invokes the ChildRemoved event
Declaration
protected virtual void OnChildRemoved(ProfileElement child)
Parameters
Type | Name | Description |
---|---|---|
ProfileElement | child |
OnDescendentAdded(ProfileElement)
Invokes the DescendentAdded event
Declaration
protected virtual void OnDescendentAdded(ProfileElement child)
Parameters
Type | Name | Description |
---|---|---|
ProfileElement | child |
OnDescendentRemoved(ProfileElement)
Invokes the DescendentRemoved event
Declaration
protected virtual void OnDescendentRemoved(ProfileElement child)
Parameters
Type | Name | Description |
---|---|---|
ProfileElement | child |
RemoveChild(ProfileElement)
Removes a profile element from the Children collection
Declaration
public virtual void RemoveChild(ProfileElement child)
Parameters
Type | Name | Description |
---|---|---|
ProfileElement | child | The profile element to remove |
Render(SKCanvas, SKPointI, ProfileElement?)
Renders the element
Declaration
public abstract void Render(SKCanvas canvas, SKPointI basePosition, ProfileElement? editorFocus)
Parameters
Type | Name | Description |
---|---|---|
SKCanvas | canvas | The canvas to render upon. |
SKPointI | basePosition | The base position to use to translate relative positions to absolute positions. |
ProfileElement | editorFocus | An optional element to focus on while rendering (other elements will not render). |
Reset()
Resets the internal state of the element
Declaration
public abstract void Reset()
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Update(double)
Updates the element
Declaration
public abstract void Update(double deltaTime)
Parameters
Type | Name | Description |
---|---|---|
double | deltaTime |
Events
ChildAdded
Occurs when a child was added to the Children list
Declaration
public event EventHandler<ProfileElementEventArgs>? ChildAdded
Event Type
Type | Description |
---|---|
EventHandler<ProfileElementEventArgs> |
ChildRemoved
Occurs when a child was removed from the Children list
Declaration
public event EventHandler<ProfileElementEventArgs>? ChildRemoved
Event Type
Type | Description |
---|---|
EventHandler<ProfileElementEventArgs> |
DescendentAdded
Occurs when a child was added to the Children list of this element or any of it's descendents.
Declaration
public event EventHandler<ProfileElementEventArgs>? DescendentAdded
Event Type
Type | Description |
---|---|
EventHandler<ProfileElementEventArgs> |
DescendentRemoved
Occurs when a child was removed from the Children list of this element or any of it's descendents.
Declaration
public event EventHandler<ProfileElementEventArgs>? DescendentRemoved
Event Type
Type | Description |
---|---|
EventHandler<ProfileElementEventArgs> |