using System; using System.Collections.Generic; using System.Text; namespace InABox.Core { /// /// Base interface for all "Posters" - classes that define the means of processing an . /// There is little point in directly implementing this; rather, one should implement a subinterface. /// The functionality of any is essentially the default functionality, and, based on the subinterface implemented, /// will be scriptable. /// /// The type of entity that this poster can process. /// The specific to this type of poster. public interface IPoster where TEntity : Entity, IPostable, IRemotable, IPersistent, new() where TSettings : PosterSettings { TSettings Settings { get; set; } } /// /// An interface to declare that an provides a means to determine if a given /// needs to be reposted. This function is to be called on the server side when a is saved. /// /// public interface IAutoRefreshPoster where TAutoRefresher : IAutoRefresher { } public interface IAutoRefresher { /// /// Return if should be reposted, which will update its to /// . /// /// /// bool ShouldRepost(TEntity entity); } public interface IGlobalSettingsPoster { public IGlobalPosterSettings GlobalSettings { get; set; } } /// /// Declares that an has global, entity-independent settings. /// public interface IGlobalSettingsPoster : IGlobalSettingsPoster where TGlobalSettings : BaseObject, IGlobalPosterSettings { public new TGlobalSettings GlobalSettings { get; set; } IGlobalPosterSettings IGlobalSettingsPoster.GlobalSettings { get => GlobalSettings; set { if(value is TGlobalSettings settings) { GlobalSettings = settings; } } } } }