direct.showbase.Pool

from direct.showbase.Pool import Pool

Pool is a collection of python objects that you can checkin and checkout. This is useful for a cache of objects that are expensive to load and can be reused over and over, like splashes on cannonballs, or bulletholes on walls. The pool is unsorted. Items do not have to be unique or be the same type.

Internally the pool is implemented with 2 lists, free items and used items.

Example

p = Pool([1, 2, 3, 4, 5])
x = p.checkout()
p.checkin(x)

Inheritance diagram

digraph inheritancef8a4ca3d5a { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "Pool" [URL="direct.showbase.Pool.html#direct.showbase.Pool.Pool",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; }
class Pool(free=None)[source]

Bases: object

notify = <direct.directnotify.Notifier.Notifier object>