using OwnChar.Model; namespace OwnChar.Api; public interface IDataProvider { bool IsInitialized(); void SetInitialized(); bool SaveDatabase(); // Model abstract T? Create() where T : OwnCharObject; abstract bool Save(T obj) where T : OwnCharObject; abstract bool Delete(T obj) where T : OwnCharObject; // Hierarchy abstract bool SetParent(UserProfile profile, UserAccount parent); abstract bool SetParent(Character character, Group parent); abstract bool SetParent(Property property, Character character); abstract bool SetOwner(Group group, UserProfile owner); abstract bool SetOwner(Character group, UserProfile owner); // Gets abstract UserAccount? GetUserAccount(string username, string password); abstract UserProfile? GetUserProfile(string username); abstract IEnumerable? GetMembers(Group group); abstract UserProfile? GetOwner(Group group); abstract UserProfile? GetOwner(Character character); abstract IEnumerable? GetCharacters(Group group); abstract IEnumerable? GetCharacters(UserProfile jprofile); // Sets abstract bool AddMember(Group group, UserProfile user); abstract bool RemoveMember(Group group, UserProfile user); }