Grabbing the top card of a deck, or bottom

I’ve looked at vassalengine.org/wiki/Creating_Modules , and couldn’t find the answer (property names and such).

So, how do I know which game piece is the top card in a deck? Any special property to check for?

Similarly, how do I grab the bottom card in a deck?