hla: Rename HLAVariantData* to HLAVariantRecordData*.
Rename the variant record data types and elements to something more standard conformant. This catches up with recent changes in simgear.
This commit is contained in:
parent
c5ddd7b1f3
commit
5ca01925cd
1 changed files with 9 additions and 9 deletions
|
@ -45,7 +45,7 @@
|
||||||
#include <simgear/hla/HLAObjectClass.hxx>
|
#include <simgear/hla/HLAObjectClass.hxx>
|
||||||
#include <simgear/hla/HLAObjectInstance.hxx>
|
#include <simgear/hla/HLAObjectInstance.hxx>
|
||||||
#include <simgear/hla/HLAPropertyDataElement.hxx>
|
#include <simgear/hla/HLAPropertyDataElement.hxx>
|
||||||
#include <simgear/hla/HLAVariantDataElement.hxx>
|
#include <simgear/hla/HLAVariantRecordDataElement.hxx>
|
||||||
|
|
||||||
#include <AIModel/AIMultiplayer.hxx>
|
#include <AIModel/AIMultiplayer.hxx>
|
||||||
#include <AIModel/AIManager.hxx>
|
#include <AIModel/AIManager.hxx>
|
||||||
|
@ -559,15 +559,15 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Factory class that is used to create an apternative data element for the multiplayer property attribute
|
// Factory class that is used to create an apternative data element for the multiplayer property attribute
|
||||||
class MPPropertyVariantDataElementFactory : public sg::HLAVariantArrayDataElement::AlternativeDataElementFactory {
|
class MPPropertyVariantRecordDataElementFactory : public sg::HLAVariantArrayDataElement::AlternativeDataElementFactory {
|
||||||
public:
|
public:
|
||||||
MPPropertyVariantDataElementFactory(PropertyReferenceSet* propertyReferenceSet) :
|
MPPropertyVariantRecordDataElementFactory(PropertyReferenceSet* propertyReferenceSet) :
|
||||||
_propertyReferenceSet(propertyReferenceSet)
|
_propertyReferenceSet(propertyReferenceSet)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
virtual sg::HLADataElement* createElement(const sg::HLAVariantDataElement& variantDataElement, unsigned index)
|
virtual sg::HLADataElement* createElement(const sg::HLAVariantRecordDataElement& variantRecordDataElement, unsigned index)
|
||||||
{
|
{
|
||||||
const sg::HLAVariantDataType* dataType = variantDataElement.getDataType();
|
const sg::HLAVariantRecordDataType* dataType = variantRecordDataElement.getDataType();
|
||||||
if (!dataType)
|
if (!dataType)
|
||||||
return 0;
|
return 0;
|
||||||
const sg::HLAEnumeratedDataType* enumDataType = dataType->getEnumeratedDataType();
|
const sg::HLAEnumeratedDataType* enumDataType = dataType->getEnumeratedDataType();
|
||||||
|
@ -594,7 +594,7 @@ public:
|
||||||
_propertyReferenceSet(new PropertyReferenceSet),
|
_propertyReferenceSet(new PropertyReferenceSet),
|
||||||
_mpProperties(new sg::HLAVariantArrayDataElement)
|
_mpProperties(new sg::HLAVariantArrayDataElement)
|
||||||
{
|
{
|
||||||
_mpProperties->setAlternativeDataElementFactory(new MPPropertyVariantDataElementFactory(_propertyReferenceSet.get()));
|
_mpProperties->setAlternativeDataElementFactory(new MPPropertyVariantRecordDataElementFactory(_propertyReferenceSet.get()));
|
||||||
}
|
}
|
||||||
virtual ~MPAttributeCallback()
|
virtual ~MPAttributeCallback()
|
||||||
{ }
|
{ }
|
||||||
|
@ -660,9 +660,9 @@ public:
|
||||||
if (_mpProperties.valid() && _mpProperties->getNumElements() == 0) {
|
if (_mpProperties.valid() && _mpProperties->getNumElements() == 0) {
|
||||||
if (_propertyReferenceSet.valid() && _propertyReferenceSet->getRootNode()) {
|
if (_propertyReferenceSet.valid() && _propertyReferenceSet->getRootNode()) {
|
||||||
const sg::HLADataType* elementDataType = _mpProperties->getElementDataType();
|
const sg::HLADataType* elementDataType = _mpProperties->getElementDataType();
|
||||||
const sg::HLAVariantDataType* variantDataType = elementDataType->toVariantDataType();
|
const sg::HLAVariantRecordDataType* variantRecordDataType = elementDataType->toVariantRecordDataType();
|
||||||
for (unsigned i = 0, count = 0; i < variantDataType->getNumAlternatives(); ++i) {
|
for (unsigned i = 0, count = 0; i < variantRecordDataType->getNumAlternatives(); ++i) {
|
||||||
std::string name = variantDataType->getAlternativeSemantics(i);
|
std::string name = variantRecordDataType->getAlternativeSemantics(i);
|
||||||
SGPropertyNode* node = _propertyReferenceSet->getRootNode()->getNode(name);
|
SGPropertyNode* node = _propertyReferenceSet->getRootNode()->getNode(name);
|
||||||
if (!node)
|
if (!node)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue