*** empty log message ***
#include <string> #include "BitmapFont.h" #include "Assumption.h" /* @ : 黒 */ /* . : 白 */ /* else(?) : どちらでも */ class PatMatch{ private: int width, height; string pat; Assumption assumption; public: PatMatch(int w,int h,string s,Assumption as) :width(w), height(h), pat(s), assumption(as){ assert(pat.length() == (unsigned int)width*height); } bool isMatch(const BitmapFont& bf, int x, int y) const{ for(int i=0;i<width;i++) for(int j=0;j<height;j++){ if(bf.get(x+i,y+j)){ if(pat[j*width+i]=='.') return false; } else if(pat[j*width+i]=='@') return false; } return true; } };
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |