当前位置: 首页>>代码示例>>C++>>正文


C++ Checker类代码示例

本文整理汇总了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();
}
开发者ID:Kijjakarn,项目名称:Stroustrup-PPP2-Exercises,代码行数:25,代码来源:ch14_ex9.cpp

示例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)};
}
开发者ID:petersohn,项目名称:sokoban,代码行数:35,代码来源:ExpandHelper.hpp

示例3: OneOrMore

Checker* ThermalModelSimple::getChecker() const
{
  Checker *check = ThermalModel::getChecker();
  check->addBlock("updraft", new OneOrMore());
  check->addChecker("updraft", Updraft::getChecker());
  return check;
}
开发者ID:lrodriguez15,项目名称:resolution,代码行数:7,代码来源:ThermalModelSimple.cpp

示例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();
}
开发者ID:garrylachman,项目名称:QProxyCheckerLib,代码行数:9,代码来源:qproxycheckerlib.cpp

示例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;
}
开发者ID:lrodriguez15,项目名称:resolution,代码行数:10,代码来源:ControllerSimpleGlider.cpp

示例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;
}
开发者ID:lrodriguez15,项目名称:resolution,代码行数:11,代码来源:FireworksConfig.cpp

示例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;
}
开发者ID:lrodriguez15,项目名称:thermal_ws,代码行数:11,代码来源:TemporalConstrain.cpp

示例8: graph

void graph(Checker &checker, const Params &params) {
	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));
}
开发者ID:blackwarthog,项目名称:lab,代码行数:14,代码来源:iir_blur.cpp

示例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);
}
开发者ID:takaki,项目名称:python-kconv,代码行数:15,代码来源:checker.cpp

示例10: find_near

double find_near(Checker &checker, double step, Params &params) {
	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;
}
开发者ID:blackwarthog,项目名称:lab,代码行数:17,代码来源:iir_blur.cpp

示例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;
}
开发者ID:blueguitarenator,项目名称:cpp11Checkers,代码行数:17,代码来源:Checker.cpp

示例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();
}
开发者ID:napszel,项目名称:CuteGammon,代码行数:17,代码来源:point.cpp

示例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;
};
开发者ID:takaki,项目名称:python-kconv,代码行数:19,代码来源:_kconv.cpp

示例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);
	}
}
开发者ID:LPPOINT,项目名称:Checkers,代码行数:19,代码来源:Grid.cpp

示例15: repair

void repair()
{
    w.loadFileStructure();
    ch.analyze();
    if(ch.getErrorCount() > 0)
    {
        if(ch.repair(true)==0)
        {
            repair();
        }
    }
}
开发者ID:jmu0,项目名称:flexdir,代码行数:12,代码来源:flexdir.cpp


注:本文中的Checker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。