void cDetectNpc::OnProcess() { switch( m_pFsmClass->GetCurState() ) { case NPC_NORMAL: { DoDetect(); DoWander(); } break; case NPC_DISCOMPORT: { DoDisComport(); } break; default: { cNpc::OnProcess(); } break; } }
TextureRef FileImpl::Read(wchar_t *path) { if (stream.is_open()) stream.close(); FileFormat &&format = DoDetect(path); stream.close(); switch (format) { case FileFormat::BMP: { BMP bmp; return bmp.ToTexture(path); } case FileFormat::PNG: { PNG png; return png.ToTexture(path); } default: return TextureRef(); } }