Beispiel #1
0
        public List <T> FindAll <T>(SerializableDataTable <T> table, Predicate <T> predicate) where T : IData
        {
            var allValues = new List <T>(table.GetValuesTyped());
            var filtered  = allValues.FindAll(predicate);

            return(filtered);
        }
Beispiel #2
0
        public bool HasById <T>(SerializableDataTable <T> table, string id) where T : IData
        {
            T value = (T)table.GetValue(id);

            if (value == null)
            {
                return(false);
            }
            return(true);
        }
Beispiel #3
0
        public T GetById <T>(SerializableDataTable <T> table, string id) where T : IData
        {
            T value = (T)table.GetValue(id);

            if (value == null)
            {
                Debug.LogWarning("Cannot find id '" + id + "' in table " + table.GetType().Name);
                return(default(T));
            }
            return(value);
        }
Beispiel #4
0
        public List <T> GetAll <T>(SerializableDataTable <T> table) where T : IData
        {
            var allValues = new List <T>(table.GetValuesTyped());

            return(allValues);
        }