00001 #include "osl/container/ptypeOPositionVector.h" 00002 #include "osl/eval/pieceEval.h" 00003 #include <algorithm> 00004 00005 namespace osl 00006 { 00007 struct PtypeOPositionLessThan 00008 { 00009 bool operator()(const std::pair<PtypeO,Position>& l, 00010 const std::pair<PtypeO,Position>& r) 00011 { 00012 const int vall = abs(eval::Ptype_Eval_Table.captureValue(l.first)); 00013 const int valr = abs(eval::Ptype_Eval_Table.captureValue(r.first)); 00014 if (vall != valr) 00015 return vall < valr; 00016 return l.second.uintValue() < r.second.uintValue(); 00017 } 00018 }; 00019 00020 void container::PtypeOPositionVector::sort() 00021 { 00022 std::sort(begin(),end(),PtypeOPositionLessThan()); 00023 } 00024 00025 } 00026 // ;;; Local Variables: 00027 // ;;; mode:c++ 00028 // ;;; c-basic-offset:2 00029 // ;;; End: