コード例 #1
0
ファイル: Network.cs プロジェクト: narfman0/BountyBandits
 private void receiveFullObjectsUpdate(NetIncomingMessage im)
 {
     #region GameItems
     int count = im.ReadInt32();
     for (int i = 0; i < count; i++)
     {
         String   gameItemXML = im.ReadString();
         GameItem item        = GameItem.fromXML(XMLUtil.asXML(gameItemXML));
         if (!gameref.activeItems.ContainsKey(item.guid))
         {
             gameref.addGameItem(item);
         }
     }
     #endregion
     // TODO must remove picked up objects and implement updates for dropped items
     #region DropItems
     count = im.ReadInt32();
     for (int i = 0; i < count; i++)
     {
         DropItem item = DropItem.fromXML(XMLUtil.asXML(im.ReadString()));
         if (!gameref.activeItems.ContainsKey(item.guid))
         {
             gameref.addGameItem(item);
         }
     }
     #endregion
 }