27 lines
471 B
C#
27 lines
471 B
C#
using System.Collections.Generic;
|
|
|
|
namespace DataTables {
|
|
|
|
public class Table<ID, T>
|
|
{
|
|
protected List<T> L;
|
|
protected Dictionary<ID, T> M;
|
|
|
|
public List<T> List() {
|
|
return L;
|
|
}
|
|
|
|
public Dictionary<ID, T> Map() {
|
|
return M;
|
|
}
|
|
|
|
public T Get(ID id)
|
|
{
|
|
if (M == null)
|
|
{
|
|
return default;
|
|
}
|
|
return M[id];
|
|
}
|
|
}
|
|
} |