Hi every body, i want to get a data from List<T> so;
class Npc : IDisposable
{
public short id;
public float fX;
public float fZ;
public float fY;
}
internal List<Npc> m_arNpcArray = new List<Npc>();
I want to get data like this;
m_arNpcArray.GetData(int id);
GetData() {
for(int i = 0; i < List.Count; i++) {
if(List[i].id == id)
{
return List[i];
}
}
}
how can i declare m_arNpcArray.GetData ??