feat(Database) Direct database/Throne links now work in the database. Added a Detailed/Plain view button
This commit is contained in:
@@ -190,10 +190,23 @@ public interface IEntityFilterService {
|
||||
public void Unsubscribe(EntityFilterAction action);
|
||||
}
|
||||
|
||||
|
||||
public interface IEntityService {
|
||||
public List<EntityModel> GetEntities();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public interface IEntityDisplayService
|
||||
{
|
||||
public List<string> DefaultChoices();
|
||||
|
||||
public string GetDisplayType();
|
||||
public void SetDisplayType(string displayType);
|
||||
public void Subscribe(Action action);
|
||||
public void Unsubscribe(Action action);
|
||||
}
|
||||
|
||||
public interface IImmortalSelectionService {
|
||||
public string GetFactionType();
|
||||
public string GetImmortalType();
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
using Model.Immortal.Types;
|
||||
|
||||
namespace Services.Immortal;
|
||||
|
||||
public class EntityDisplayService : IEntityDisplayService {
|
||||
private string displayType = "Detailed";
|
||||
private event Action _onChange;
|
||||
|
||||
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 Action OnChange() {
|
||||
return _onChange;
|
||||
}
|
||||
|
||||
public string GetDisplayType()
|
||||
{
|
||||
return displayType;
|
||||
}
|
||||
|
||||
public void SetDisplayType(string displayType)
|
||||
{
|
||||
this.displayType = displayType;
|
||||
NotifyDataChanged();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ public class EntityFilterService : IEntityFilterService {
|
||||
private string _selectedFaction = FactionType.Any;
|
||||
private string _selectedImmortal = ImmortalType.Any;
|
||||
|
||||
|
||||
|
||||
public EntityFilterService() {
|
||||
RefreshImmortalChoices();
|
||||
RefreshEntityChoices();
|
||||
@@ -46,7 +46,7 @@ public class EntityFilterService : IEntityFilterService {
|
||||
public string GetImmortalType() {
|
||||
return _selectedImmortal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool SelectFactionType(string factionType) {
|
||||
if (_selectedFaction == factionType) {
|
||||
|
||||
Reference in New Issue
Block a user