本文整理汇总了C#中System.Point.ReadXml方法的典型用法代码示例。如果您正苦于以下问题:C# Point.ReadXml方法的具体用法?C# Point.ReadXml怎么用?C# Point.ReadXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Point
的用法示例。
在下文中一共展示了Point.ReadXml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadXml
public void ReadXml(System.Xml.XmlReader reader)
{
m_stairMapping = new Dictionary<Guid, Point>();
reader.ReadStartElement();
int count = reader.ReadElementContentAsInt();
for (int i = 0; i < count; ++i)
{
Guid g = new Guid(reader.ReadElementContentAsString());
Point destination = new Point();
destination = destination.ReadXml(reader);
m_stairMapping[g] = destination;
}
reader.ReadEndElement();
}
示例2: ReadXml
public void ReadXml(XmlReader reader)
{
reader.ReadStartElement();
m_width = reader.ReadElementContentAsInt();
m_height = reader.ReadElementContentAsInt();
m_map = new MapTile[m_width, m_height];
for (int i = 0; i < m_width; ++i)
{
for (int j = 0; j < m_height; ++j)
{
m_map[i, j] = new MapTile();
m_map[i, j].ReadXml(reader);
}
}
// Read Map Features
m_mapObjects = new List<IMapObjectCore>();
ReadListFromXMLCore readDelegate = new ReadListFromXMLCore(delegate
{
string typeString = reader.ReadElementContentAsString();
MapObject newObj = MapObjectFactory.Instance.CreateMapObject(typeString);
newObj.ReadXml(reader);
m_mapObjects.Add(newObj);
});
ListSerialization.ReadListFromXML(reader, readDelegate);
// Read Monsters
m_monsterList = new List<Monster>();
readDelegate = new ReadListFromXMLCore(delegate
{
string typeString = reader.ReadElementContentAsString();
int baseLevel = reader.ReadElementContentAsInt();
Monster newObj = MonsterFactory.Instance.CreateMonster(typeString, baseLevel);
newObj.ReadXml(reader);
m_monsterList.Add(newObj);
});
ListSerialization.ReadListFromXML(reader, readDelegate);
// Read Items
m_items = new List<Pair<Item, Point>>();
readDelegate = new ReadListFromXMLCore(delegate
{
string typeString = reader.ReadElementContentAsString();
Item newItem = ItemFactory.Instance.CreateBaseItem(typeString);
newItem.ReadXml(reader);
Point position = new Point();
position = position.ReadXml(reader);
m_items.Add(new Pair<Item, Point>(newItem, position));
});
ListSerialization.ReadListFromXML(reader, readDelegate);
reader.ReadEndElement();
}