当前位置: 首页>>代码示例>>C#>>正文


C# Point.ReadXml方法代码示例

本文整理汇总了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();
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:14,代码来源:StairsMapping.cs

示例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();
        }
开发者ID:donblas,项目名称:magecrawl,代码行数:58,代码来源:Map.cs


注:本文中的System.Point.ReadXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。