本文整理汇总了C++中Checker类的典型用法代码示例。如果您正苦于以下问题:C++ Checker类的具体用法?C++ Checker怎么用?C++ Checker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Checker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
using namespace Graph_lib;
Simple_window win {Point{100, 100}, 800, 600, "Exercise 9"};
Checker ck {50};
ck.set_color(Color::green);
Circle c {Point{200, 200}, 30};
c.set_color(Color::black);
c.set_fill_color(Color::white);
Rectangle r {Point{100, 50}, 30, 40};
r.set_color(Color::red);
r.set_fill_color(Color::yellow);
ck.add_shape(c);
ck.add_shape(r);
ck.move(0, 4, 1);
ck.move(1, 5, 3);
win.attach(ck);
win.attach(ck.shape(0));
win.attach(ck.shape(1));
win.wait_for_button();
}
示例2: createNode
std::pair<std::shared_ptr<Node>, boost::optional<Status>>
createNode(const Status& originalStatus, Point p, Point d,
const std::shared_ptr<Node>& base, NodeFactory& nodeFactory,
const HeurCalculator& heurCalculator, const Checker& checker,
Dumper* dumper)
{
Point pd = p+d, pmd = p-d;
if (originalStatus.value(pd) != FieldType::floor ||
!originalStatus.reachable(pmd)) {
return {};
}
Status status(originalStatus);
status.currentPos(p);
if (heurCalculator.calculateStone(status, pd) < 0 ||
!status.moveStone(p, pd)) {
return {};
}
auto doCreateNode =
[&]() {
return nodeFactory.createNode(
status, MoveDescriptor(p, d), base);
};
if (pd != status.table().destination()) {
if (!checker.check(status, pd)) {
if (dumper) {
dumper->reject(doCreateNode(), checker.errorMessage());
}
return {};
}
}
return {doCreateNode(), std::move(status)};
}
示例3: OneOrMore
Checker* ThermalModelSimple::getChecker() const
{
Checker *check = ThermalModel::getChecker();
check->addBlock("updraft", new OneOrMore());
check->addChecker("updraft", Updraft::getChecker());
return check;
}
示例4: ProxyItem
void QProxyCheckerLib::checkProxy(ProxyItem::ProxyType proxyType, QString hostname, int port,
QString username, QString password)
{
ProxyItem* proxyItem = new ProxyItem(proxyType, hostname, port, username, password, this);
QObject::connect(proxyItem, SIGNAL(checkingStatusChanged(ProxyItem*, ProxyItem::CheckingStatus)),
this, SLOT(checkingStatusChanged(ProxyItem*, ProxyItem::CheckingStatus)));
Checker* checker = new Checker(proxyItem, this);
checker->start();
}
示例5: Checker
Checker *ControllerSimpleGlider::controllerFileChecker() const {
//! \Note Dummy
Checker *ret = new Checker();
ret->addProperty("speed", new NTimes(1));
ret->addProperty("min_wp_dist", new NTimes(1));
ret->addBlock("flight_plan", new NTimes(1));
FlightPlan fp;
ret->addChecker("flight_plan", fp.getFlightPlanChecker());
return ret;
}
示例6: getChecker
Checker* FireworksConfig::getChecker()
{
Checker *check = CostConfig::getConfigChecker();
check->addProperty("am", new NTimes(1));
check->addProperty("bm", new NTimes(1));
check->addProperty("mm", new NTimes(1));
check->addProperty("m", new NTimes(1));
return check;
}
示例7: getChecker
Checker* TemporalConstrain::getChecker()
{
Checker *check = new Checker;
check->addProperty("min_time", new NTimes(1));
check->addProperty("max_time", new NTimes(1));
check->addProperty("updraft_id", new NTimes(1));
check->addProperty("uav_id", new NTimes(1));
return check;
}
示例8: graph
void graph(Checker &checker, const Params ¶ms) {
int ri = roundf(checker.radius);
if (fabs(checker.radius - ri) > 1e-5) return;
bool is_power_of_two = false;
for(int i = 1; i <= 4096; i *= 2)
if (ri == i) is_power_of_two = true;
if (!is_power_of_two && ri%16 != 0)
return;
checker.check2(params);
checker.graph(strprintf("iir_%04d.tga", ri));
}
示例9: main
int main(int argc,char **argv){
FILE *fin;
if((fin = fopen("zenkana.sjis","r")) == NULL){
printf("File open Error.\n");
exit(255);
}
char *inputstring = new char[1024];
fscanf(fin,"%s",inputstring);
strcat(inputstring,"\n");
Checker *ip = new FastChecker();
printf("%d",ip->ChkCoding((unsigned char*)inputstring));
delete ip;
fclose(fin);
return(0);
}
示例10: find_near
double find_near(Checker &checker, double step, Params ¶ms) {
double best_value = checker.check2(params);
Params best_params = params;
while(true) {
bool found = false;
for(int i = 0; i < 3; ++i) {
for(int j = -1; j <= 1; j += 2) {
Params p = params;
p.k[i] += j*step;
double v = checker.check2(p);
if (v < best_value) { best_value = v; best_params = p; }
}
}
if (found) params = best_params; else break;
}
return best_value;
}
示例11: hasJump
bool Checker::hasJump(Checkers::DirectionType dir)
{
Square* neighbor = Checkers::getNeighborSquare(m_square, dir);
if (neighbor != nullptr)
{
Checker* checker = neighbor->getChecker();
if (checker != nullptr && checker->getColor() != m_myColor)
{
Square* jumpSquare = Checkers::getNeighborSquare(neighbor, dir);
if (jumpSquare != nullptr && jumpSquare->getChecker() == nullptr)
{
return true;
}
}
}
return false;
}
示例12: killedChecker
void Point::dropEvent(QDropEvent * event) {
if (event->mimeData()->hasFormat("application/x-backgammon-checkerdrop")) {
int thisCheckersColor = ((Checker*) event->source())->getMyColor();
if ((getCheckersNo() < 2) || (thisCheckersColor == checkersColor())) {
event->acceptProposedAction();
Checker *thisChecker = (Checker*) event->source();
thisChecker->getMyPlace()->removeChecker();
if ((getCheckersNo() == 1) && (thisCheckersColor != checkersColor())) { //hit
emit killedChecker(topChecker());
removeChecker();
}
addChecker(thisChecker);
} else
event->ignore();
} else
event->ignore();
}
示例13: CallChecker
static PyObject*
CallChecker(PyObject *self, PyObject *args)
{
unsigned char *str;
int type;
int len;
Codes ret;
PyObject *pret;
Checker *op;
if(!PyArg_ParseTuple(args, "is#", &type, &str, &len)){
return NULL;
}
op = CheckerTable[type]();
ret = op->ChkCoding(str, len);
pret = Py_BuildValue("i", ret);
delete op;
return pret;
};
示例14: if
void Grid::SelectCheker(Checker::CheckerColor clr)
{
Checker* checker;
for(int i = 0; i < _cells.size(); i++)
{
if(checker = GetChecker(_cells[i]))
{
if(checker->GetColor()==clr)
{
checker->GetCell()->AddComponent(new CheckerFlushCellComponent);
}
else if(checker->GetColor()!=clr)
{
checker->GetCell()->EraseComponent(new CheckerFlushCellComponent);
}
}
else _cells[i]->EraseComponent(new CheckerFlushCellComponent);
}
}
示例15: repair
void repair()
{
w.loadFileStructure();
ch.analyze();
if(ch.getErrorCount() > 0)
{
if(ch.repair(true)==0)
{
repair();
}
}
}