00001 /* allMobility.cc 00002 */ 00003 #include "osl/mobility/allMobility.h" 00004 #include "osl/mobility/rookMobility.h" 00005 #include "osl/mobility/bishopMobility.h" 00006 #include "osl/mobility/lanceMobility.h" 00007 00008 int osl::mobility:: 00009 AllMobility::count(const NumEffectState& state, Piece p) 00010 { 00011 const Player owner = p.owner(); 00012 switch (p.ptype()) { 00013 case ROOK: 00014 case PROOK: 00015 return RookMobility::countHorizontalAll(owner, state, p) 00016 + RookMobility::countVerticalAll(owner, state, p); 00017 case BISHOP: 00018 case PBISHOP: 00019 return BishopMobility::countAll(owner, state, p); 00020 case LANCE: 00021 return LanceMobility::countAll(owner, state, p); 00022 default: 00023 return 0; 00024 } 00025 } 00026 00027 00028 /* ------------------------------------------------------------------------- */ 00029 // ;;; Local Variables: 00030 // ;;; mode:c++ 00031 // ;;; c-basic-offset:2 00032 // ;;; End: