Added convenience functions rawPool(Color) to CrazyhousePosition.
commit0f86d7a4a272956aa95f5e760a56d04d754378e1
authorPaolo Capriotti <p.capriotti@gmail.com>
Sun, 15 Jul 2007 10:30:00 +0000 (15 12:30 +0200)
committerPaolo Capriotti <p.capriotti@gmail.com>
Sun, 15 Jul 2007 10:30:00 +0000 (15 12:30 +0200)
treeeaf3891a4f5c4f9f66bdc4ff172b4b786a707831
parent15a221f38a2134aef80bc0179a6bf37caf17491b
Added convenience functions rawPool(Color) to CrazyhousePosition.

The only const cast is now encapsulated inside rawPool. It could be eliminated,
but that would require a new class wrapping "const PlayerPool&", so that it can
be returned from rawPool.

Right now this is not possible, because creating a new PlayerPool when it is
not found inside the pool would create either a dangling pointer or a memory
leak. The current solution is to add the PlayerPool directly into the Pool
using map::operator[]. This requires a const_cast, but it should be pretty
safe.
src/variants/crazyhouse.cpp
src/variants/crazyhouse_p.h
src/variants/xchess/dropanimator.impl.h [changed mode: 0644->0755]