コード例 #1
0
ファイル: PropertyIO.cpp プロジェクト: cubemoon/game-editor
wxString xsListRealPointPropIO::ToString(RealPointList value)
{
	wxString out = wxT("[ ");

	RealPointList::compatibility_iterator node = value.GetFirst();
	while( node )
	{
		out << xsRealPointPropIO::ToString(*(wxRealPoint*)node->GetData());
		if( node != value.GetLast() ) out << wxT(" | ");

		node = node->GetNext();
	}

	out << wxT(" ]");

	return out;
}
コード例 #2
0
ファイル: PropertyIO.cpp プロジェクト: cubemoon/game-editor
void xsListRealPointPropIO::Write(xsProperty *property, wxXmlNode *target)
{
    RealPointList *list = (RealPointList*)property->m_pSourceVariable;

    if(list->GetCount() > 0)
    {
        wxXmlNode *newNode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("property"));
		RealPointList::compatibility_iterator listNode = list->GetFirst();
        while(listNode)
        {
            AddPropertyNode(newNode, wxT("item"), xsRealPointPropIO::ToString(*(wxRealPoint*)listNode->GetData()));
            listNode = listNode->GetNext();
        }

        target->AddChild(newNode);
        AppendPropertyType(property, newNode);
    }
}