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


C++ MoveList::GetCombinedMove方法代码示例

本文整理汇总了C++中MoveList::GetCombinedMove方法的典型用法代码示例。如果您正苦于以下问题:C++ MoveList::GetCombinedMove方法的具体用法?C++ MoveList::GetCombinedMove怎么用?C++ MoveList::GetCombinedMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MoveList的用法示例。


在下文中一共展示了MoveList::GetCombinedMove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BestMoveAfterPard

bool BestMoveAfterPard(
  Holding& holding,
  DefList& def)
{
  int slNew = 0, cNew = 0;

  holding.SetRhoNo();
  if (! holding.MakePlay(slNew, cNew))
  {
    const Trick& trick = holding.GetTrick();
    def.Set1(trick);

    if (debugComplex)
    {
      DumpStatus(def, "BestMoveAfterPard: Simple play");
      holding.PrintPlayNew(cout);
    }

    return true;
  }

  assert(slNew >= 1 && slNew <= 12);
  assert(cNew >= 0 && cNew < SDS_NUMSINGLES[slNew]);


  if (singles[slNew][cNew].moveNo == 0)
  {
    Holding tmpHolding;
    tmpHolding.Set(slNew, cNew);

    if (debugComplex)
    {
      cout << "Start recursing\n";
      tmpHolding.Print(cout);
    }

    DefList deftmp1, deftmp2;
      
    bool newFlag;
    MakeComplexSingleMove(tmpHolding, deftmp1, deftmp2);
    int sl = tmpHolding.GetSuitLength();
    int c = tmpHolding.GetCounter();
    // TODO: Does tmpHolding really change in the invocation?
    singles[sl][c].moveNo = moveList.AddMoves(
      deftmp1, deftmp2, tmpHolding, newFlag);

    if (debugComplex)
    {
      deftmp1.Print(cout);
      deftmp2.Print(cout);
      cout << "Done recursing\n";
    }
  }

  assert(singles[slNew][cNew].moveNo != 0);
  def = moveList.GetCombinedMove(singles[slNew][cNew].moveNo);

  if (debugComplex)
  {
    DumpStatus(def, "BestMoveAfterPard: Stored play count", slNew, cNew);
    Holding hTmp;
    hTmp.Set(slNew, cNew);
    hTmp.Print(cout);
    holding.PrintPlayNew(cout);
    fflush(stdout);
  }

  def += holding;
// cout << "After +=, dc " << debugComplex << endl;

  if (debugComplex)
    DumpStatus(def, "Prepended: Stored play count");
// cout.flush();

  return true;
}
开发者ID:dss-bridge,项目名称:dss,代码行数:76,代码来源:ComplexMoves.cpp


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