#include "xphysgeomlist.h"

XPhysGeomList::XPhysGeomList()
    : XAsset()
    , mCount(0)
    , mGeoms()
    , mMass()
{
    SetName("Phys Geometry List");
}

XPhysGeomList::~XPhysGeomList()
{
    
}

void XPhysGeomList::ParseData(XDataStream *aStream)
{
    if (GetPtr() == -1)
    {
        qint32 geomsPtr;
        *aStream
            >> mCount
            >> geomsPtr;

        if (geomsPtr)
        {
            for (quint32 i = 0; i < mCount; i++)
            {
                XPhysGeomInfo newGeom;
                newGeom.ParseData(aStream);
                mGeoms.append(newGeom);
            }
        }
    }
}

void XPhysGeomList::Clear()
{
    mCount = 0;
    mGeoms.clear();
    mMass.Clear();
}
