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); }