You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
757 B
37 lines
757 B
using Model.Types; |
|
|
|
namespace Services.Immortal; |
|
|
|
public class EntityDisplayService : IEntityDisplayService { |
|
private string displayType = "Detailed"; |
|
private event Action OnChange = null!; |
|
|
|
public List<string> DefaultChoices() |
|
{ |
|
return new List<string>() { "Detailed", "Plain" }; |
|
} |
|
|
|
public void Subscribe(Action action) { |
|
OnChange += action; |
|
} |
|
|
|
public void Unsubscribe(Action action) { |
|
OnChange -= action; |
|
} |
|
|
|
private void NotifyDataChanged() { |
|
OnChange?.Invoke(); |
|
} |
|
|
|
public string GetDisplayType() |
|
{ |
|
return displayType; |
|
} |
|
|
|
public void SetDisplayType(string displayType) |
|
{ |
|
this.displayType = displayType; |
|
NotifyDataChanged(); |
|
} |
|
|
|
} |