//
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
namespace MUnique.OpenMU.Persistence;
using MUnique.OpenMU.DataModel.Configuration;
using MUnique.OpenMU.DataModel.Entities;
using MUnique.OpenMU.Interfaces;
///
/// Provider for persistence contexts.
///
public interface IPersistenceContextProvider
{
///
/// Gets the repository provider.
///
IRepositoryProvider RepositoryProvider { get; }
///
/// Creates a new context which doesn't use any caching.
///
/// The newly created context.
IContext CreateNewContext();
///
/// Creates a new context.
///
/// The game configuration.
///
/// The newly created context.
///
IContext CreateNewContext(GameConfiguration gameConfiguration);
///
/// Creates a new context which should be used to load the configuration.
/// It's not tracking changes.
///
///
/// The newly created context.
///
IConfigurationContext CreateNewConfigurationContext();
///
/// Creates the new trade context which is used to exchange items in a trade.
///
/// The newly created context.
IContext CreateNewTradeContext();
///
/// Creates a new context which is used for accounts.
/// This context should only care about the objects of a player;
/// It should not track changes of configuration objects.
///
/// The game configuration.
///
/// The newly created account context.
///
IPlayerContext CreateNewPlayerContext(GameConfiguration gameConfiguration);
///
/// Creates a new context which is used by the friend server.
/// It manages basically only s.
///
/// A new context which is used by the friend server.
IFriendServerContext CreateNewFriendServerContext();
///
/// Creates a new context which is used by the guild server.
/// It manages basically only s and s.
///
/// A new context which is used by the guild server.
IGuildServerContext CreateNewGuildContext();
///
/// Creates the new context which can be used to load and edit an object of .
///
/// The type of object which should be handled.
/// Flag, if the cache should be used.
/// The game configuration.
///
/// A new context which can be used to load and edit an object of .
///
IContext CreateNewTypedContext(Type editType, bool useCache, GameConfiguration? gameConfiguration = null);
}