Skip to content

Instantly share code, notes, and snippets.

@SnowyPainter
Created November 4, 2020 13:31
Show Gist options
  • Save SnowyPainter/ef208bc5805e31b39aa06173c974acb9 to your computer and use it in GitHub Desktop.
Save SnowyPainter/ef208bc5805e31b39aa06173c974acb9 to your computer and use it in GitHub Desktop.
In short, all of the List<inheritances> of INTERFACE can be called, It actually works just like Stack.Pop
public static class ListsExtension
{
public static T Pop<T>(this List<T> clist, int index) where T : INTERFACE
{
var c = clist[index];
cargos.RemoveAt(index);
return c;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment