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); }
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); }
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); }
public List <T> GetAll <T>(SerializableDataTable <T> table) where T : IData { var allValues = new List <T>(table.GetValuesTyped()); return(allValues); }
public IEnumerable <T> FindAllOptimized <T>(SerializableDataTable <T> table, Predicate <T> predicate) where T : IData { return(table.GetValuesTyped().Where(x => predicate(x))); }