本文整理汇总了C++中Sentence::IsEqualTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Sentence::IsEqualTo方法的具体用法?C++ Sentence::IsEqualTo怎么用?C++ Sentence::IsEqualTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentence
的用法示例。
在下文中一共展示了Sentence::IsEqualTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
IChoiceTag* IChoiceTag::Create(Sentence& sentence)
{
static Sentence kahnsOrDragons("As THIS enters the battlefield, choose Khans or Dragons.");
static Sentence opponentChoose("An opponent chooses one " HYPEN);
if (kahnsOrDragons.IsEqualTo(sentence))
{
sentence.Clear();
return new KahnsOrDragons;
}
if (opponentChoose.IsEqualTo(sentence))
{
sentence.Clear();
return new OpponentChoose;
}
auto first = sentence.Find(
[](IObjectTag* tag) -> bool { return tag->GetType() == ObjectType::Choose; });
if (first.found)
{
auto second = sentence.Find(
[](IObjectTag* tag) -> bool { return tag->GetType() == ObjectType::BigSeperator; },
first.iterator);
if (second.found)
{
return new ChoiceBegin(sentence.Splice(second.iterator));
}
}
return nullptr;
}
示例2: IsEqualTo
bool IsEqualTo(const IObjectTag* rhs_) const
{
auto rhs = dynamic_cast<const ChoiceBegin*>(rhs_);
if (rhs != nullptr) { return sentence.IsEqualTo(rhs->sentence); }
return false;
}