// Copyright (c) 2015 - 2023 Doozy Entertainment. All Rights Reserved. // This code can only be used under the standard Unity Asset Store End User License Agreement // A Copy of the EULA APPENDIX 1 is available at http://unity3d.com/company/legal/as_terms using System.Collections.Generic; // ReSharper disable InconsistentNaming // ReSharper disable UnusedMemberInSuper.Global // ReSharper disable UnusedMember.Global namespace Doozy.Runtime.Common { /// Interface used for List databases /// Key type /// Value type public interface IListDatabase { /// Add a new key to the database with the default value /// New key void Add(TKey key); /// Add a new key to the database with the given value /// New key /// New value void Add(TKey key, TValue value); /// Clear the database void Clear(); /// Check if the database contains the given key /// Key to search for /// True or False bool ContainsKey(TKey key); /// Check if the database contains the given key and value pair /// Key to search for /// Value to search for /// True or False bool ContainsValue(TKey key, TValue value); /// Check if the database contains the given value /// Value to search for /// True or False bool ContainsValue(TValue value); /// Get the number of keys in the database /// Number of keys in the database int CountKeys(); /// Get the number of values for the given key /// Key to search for /// Number of values for the given key int CountValues(TKey key); /// Get a list of all the values for the given key /// Key to search for /// A new List with all the values for the given key List GetValues(TKey key); /// Get a list of all the keys in the database /// A new list with all the keys in the database List GetKeys(); /// Remove the given key from the database /// Key to remove void Remove(TKey key); /// Remove the value from the given key /// Key to search for /// Value to remove /// If TRUE and the list of values is empty, the key will be removed as well void Remove(TKey key, TValue value, bool deleteEmptyKey = true); /// Remove the value from the database /// Value to remove /// If TRUE and the list of values is empty, the key will be removed as well void Remove(TValue value, bool deleteEmptyKey = true); /// Validate the database by removing null entries /// If TRUE and empty keys are found, they will be removed void Validate(bool deleteEmptyKeys = true); } }