示例#1
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);
        }
示例#2
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);
        }