using System; using System.Drawing; using Artemis.Core.Plugins.Interfaces; using Artemis.Core.ProfileElements; using RGB.NET.Core; using Stylet; namespace Artemis.Core.Plugins.Abstract { public abstract class ProfileModule : IModule { public Profile ActiveProfile { get; private set; } /// public abstract string DisplayName { get; } /// public abstract bool ExpandsMainDataModel { get; } /// public void EnablePlugin() { // Load and activate the last active profile } /// public virtual void Update(double deltaTime) { lock (this) { // Update the profile ActiveProfile?.Update(deltaTime); } } /// public virtual void Render(double deltaTime, RGBSurface surface, Graphics graphics) { lock (this) { // Render the profile ActiveProfile?.Render(deltaTime, surface, graphics); } } /// public abstract IScreen GetMainViewModel(); /// public void Dispose() { } public void ChangeActiveProfile(Profile profile) { lock (this) { if (profile == null) throw new ArgumentNullException(nameof(profile)); ActiveProfile?.Deactivate(); ActiveProfile = profile; ActiveProfile.Activate(); } } } }