本文整理汇总了C++中ObjectType::is_of_type方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectType::is_of_type方法的具体用法?C++ ObjectType::is_of_type怎么用?C++ ObjectType::is_of_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectType
的用法示例。
在下文中一共展示了ObjectType::is_of_type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Object Observer Interface
void
dmz::StarfighterPluginAces::create_object (
const UUID &Identity,
const Handle ObjectHandle,
const ObjectType &Type,
const ObjectLocalityEnum Locality) {
if (Type.is_of_type (_targetType)) { _targets.add (ObjectHandle); }
}
示例2: test
//.........这里部分代码省略.........
(nothingThatBecomesSomething == shouldBeNothing) &&
!(nothingThatBecomesSomething == anotherCat));
ObjectType shouldBeACaracal (CaracalName, context);
ObjectType shouldBeACat (CatName, context);
test.validate (
"test == operator",
!(shouldBeNothing == anotherCat) &&
!(shouldBeNothing == anotherCaracal) &&
!(shouldBeACaracal == anotherCat) &&
(shouldBeACaracal == anotherCaracal) &&
(shouldBeACat == anotherCat) &&
!(shouldBeACat == anotherCaracal));
test.validate (
"test != operator",
(shouldBeNothing != anotherCat) &&
(shouldBeNothing != anotherCaracal) &&
(shouldBeACaracal != anotherCat) &&
!(shouldBeACaracal != anotherCaracal) &&
!(shouldBeACat != anotherCat) &&
(shouldBeACat != anotherCaracal));
test.validate (
"test ! operator",
!shouldBeNothing &&
!(!shouldBeACat));
// </validate operators>
// ============================================================================ //
// <validate accessor functions>
ObjectType newTestObject;
test.validate (
"test is_of_type operator on a null type object",
!newTestObject.is_of_type (shouldBeNothing) &&
!newTestObject.is_of_type (anotherCat) &&
!newTestObject.is_of_type (anotherCaracal));
test.validate (
"test is_of_exact_type operator on a null type object",
!newTestObject.is_of_exact_type (shouldBeNothing) &&
!newTestObject.is_of_exact_type (anotherCat) &&
!newTestObject.is_of_exact_type (anotherCaracal));
newTestObject = anotherCat;
test.validate (
"test is_of_type operator on a base type object",
!newTestObject.is_of_type (shouldBeNothing) &&
newTestObject.is_of_type (anotherCat) &&
!newTestObject.is_of_type (anotherCaracal));
test.validate (
"test is_of_exact_type operator on a base type object",
!newTestObject.is_of_exact_type (shouldBeNothing) &&
newTestObject.is_of_exact_type (anotherCat) &&
!newTestObject.is_of_exact_type (anotherCaracal));
newTestObject = anotherCaracal;
test.validate (
"test is_of_type operator on a child type object",
!newTestObject.is_of_type (shouldBeNothing) &&
newTestObject.is_of_type (anotherCat) &&
newTestObject.is_of_type (anotherCaracal));
test.validate (
"test is_of_exact_type operator on a child type object",
!newTestObject.is_of_exact_type (shouldBeNothing) &&
!newTestObject.is_of_exact_type (anotherCat) &&
newTestObject.is_of_exact_type (anotherCaracal));