Table of Contents

Class ProfileElement

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Represents an element of a Profile

public abstract class ProfileElement : BreakableModel, IBreakableModel, IDisposable, IPluginFeatureDependent
Inheritance
object
CorePropertyChanged
ProfileElement
Implements
Derived
Inherited Members

Properties

BrokenDisplayName

Gets the display name of this breakable model

public override string BrokenDisplayName { get; }

Property Value

string

Children

The element's children

public ReadOnlyCollection<ProfileElement> Children { get; }

Property Value

ReadOnlyCollection<ProfileElement>

Disposed

Gets a boolean indicating whether the profile element is disposed

public bool Disposed { get; protected set; }

Property Value

bool

EntityId

Gets the unique ID of this profile element

public Guid EntityId { get; }

Property Value

Guid

Name

The name which appears in the editor

public string? Name { get; set; }

Property Value

string

Order

The order in which this element appears in the update loop and editor

public int Order { get; }

Property Value

int

Parent

Gets the parent of this element

public ProfileElement? Parent { get; }

Property Value

ProfileElement

Profile

Gets the profile this element belongs to

public Profile Profile { get; }

Property Value

Profile

Suspended

Gets or sets the suspended state, if suspended the element is skipped in render and update

public bool Suspended { get; set; }

Property Value

bool

Methods

AddChild(ProfileElement, int?)

Adds a profile element to the Children collection, optionally at the given position (0-based)

public virtual void AddChild(ProfileElement child, int? order = null)

Parameters

child ProfileElement

The profile element to add

order int?

The order where to place the child (0-based), defaults to the end of the collection

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Disposes the profile element

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

GetAllFolders()

Returns a flattened list of all child folders

public List<Folder> GetAllFolders()

Returns

List<Folder>

GetAllLayers()

Returns a flattened list of all child layers

public List<Layer> GetAllLayers()

Returns

List<Layer>

GetAllRenderElements()

Returns a flattened list of all child render elements

public List<RenderProfileElement> GetAllRenderElements()

Returns

List<RenderProfileElement>

GetFeatureDependencies()

Gets the plugin features this class depends on, may contain the same plugin feature twice if depending on it in multiple ways.

public abstract IEnumerable<PluginFeature> GetFeatureDependencies()

Returns

IEnumerable<PluginFeature>

A List<T> of PluginFeature this class depends on.

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

public string GetNewFolderName(string baseName = "New folder")

Parameters

baseName string

Returns

string

The resulting name i.e. New folder or New folder (2)

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

public string GetNewLayerName(string baseName = "New layer")

Parameters

baseName string

Returns

string

The resulting name i.e. New layer or New layer (2)

OnChildAdded(ProfileElement)

Invokes the ChildAdded event

protected virtual void OnChildAdded(ProfileElement child)

Parameters

child ProfileElement

OnChildRemoved(ProfileElement)

Invokes the ChildRemoved event

protected virtual void OnChildRemoved(ProfileElement child)

Parameters

child ProfileElement

OnDescendentAdded(ProfileElement)

Invokes the DescendentAdded event

protected virtual void OnDescendentAdded(ProfileElement child)

Parameters

child ProfileElement

OnDescendentRemoved(ProfileElement)

Invokes the DescendentRemoved event

protected virtual void OnDescendentRemoved(ProfileElement child)

Parameters

child ProfileElement

RemoveChild(ProfileElement)

Removes a profile element from the Children collection

public virtual void RemoveChild(ProfileElement child)

Parameters

child ProfileElement

The profile element to remove

Render(SKCanvas, SKPointI, ProfileElement?)

Renders the element

public abstract void Render(SKCanvas canvas, SKPointI basePosition, ProfileElement? editorFocus)

Parameters

canvas SKCanvas

The canvas to render upon.

basePosition SKPointI

The base position to use to translate relative positions to absolute positions.

editorFocus ProfileElement

An optional element to focus on while rendering (other elements will not render).

Reset()

Resets the internal state of the element

public abstract void Reset()

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Update(double)

Updates the element

public abstract void Update(double deltaTime)

Parameters

deltaTime double

Events

ChildAdded

Occurs when a child was added to the Children list

public event EventHandler<ProfileElementEventArgs>? ChildAdded

Event Type

EventHandler<ProfileElementEventArgs>

ChildRemoved

Occurs when a child was removed from the Children list

public event EventHandler<ProfileElementEventArgs>? ChildRemoved

Event Type

EventHandler<ProfileElementEventArgs>

DescendentAdded

Occurs when a child was added to the Children list of this element or any of it's descendents.

public event EventHandler<ProfileElementEventArgs>? DescendentAdded

Event Type

EventHandler<ProfileElementEventArgs>

DescendentRemoved

Occurs when a child was removed from the Children list of this element or any of it's descendents.

public event EventHandler<ProfileElementEventArgs>? DescendentRemoved

Event Type

EventHandler<ProfileElementEventArgs>