]> git.sesse.net Git - stockfish/commitdiff
Simplify endgame functions handling
authorMarco Costalba <mcostalba@gmail.com>
Thu, 16 Jul 2009 12:31:32 +0000 (14:31 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 17 Jul 2009 06:55:51 +0000 (07:55 +0100)
We really don't need to have global endgame functions. We can
allocate them on the heap at initialization time and store the
corresponding pointer directly in the functions maps. To avoid
leaks we just need to remember to deallocate them in map d'tor.

These functions are always created in couple, one for each color,
so remove a lot of redundant hard coded info and just use the minimum
required: the type and the corresponding named string.

This greatly simplifies the code and also it is less error prone,
now is much simpler to add a new endgame specialized function: just
add the corresponding enum in endgame.h and the obvious add_xx()
call in EndgameFunctions c'tor, and of course, the most important part,
the EvaluationFunction<xxx>::apply() specialization in endgame.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

No differences found