Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.91 KB | None | 0 0
  1. using Sulakore.Network.Protocol;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace YourrrrrrrrrrrrrMom
  9. {
  10.     class WallItem
  11.     {
  12.  
  13.         public int typeId { get; set; }
  14.         public int furniId { get; set; }
  15.         public int ownerId { get; set; }
  16.         public int isClickable { get; set; }
  17.         public int rentTime { get; set; }
  18.         public string state { get; set; }
  19.         public string position { get; set; }
  20.  
  21.         public WallItem(int furniId, int typeId, string position, string state, int rentTime, int isClickable, int ownerId)
  22.         {
  23.             this.typeId = typeId;
  24.             this.furniId = furniId;
  25.             this.ownerId = ownerId;
  26.             this.isClickable = isClickable;
  27.             this.rentTime = rentTime;
  28.             this.state = state;
  29.             this.position = position;
  30.         }
  31.  
  32.  
  33.         public static List<WallItem> ParseWallItems(HPacket packet)
  34.         {
  35.             List<WallItem> resultList = new List<WallItem>();
  36.  
  37.  
  38.             int amountowners = packet.ReadInt32();
  39.             for (int i = 0; i < amountowners; i++)
  40.             {
  41.                 packet.ReadInt32();
  42.                 packet.ReadUTF8();
  43.             }
  44.  
  45.             int amountitems = packet.ReadInt32();
  46.             for (int i = 0; i < amountitems; i++)
  47.             {
  48.                 resultList.Add(
  49.                     new WallItem(
  50.                             int.Parse(packet.ReadUTF8()),
  51.                             packet.ReadInt32(),
  52.                             packet.ReadUTF8(),
  53.                             packet.ReadUTF8(),
  54.                             packet.ReadInt32(),
  55.                             packet.ReadInt32(),
  56.                             packet.ReadInt32()
  57.                         )
  58.                     );
  59.             }
  60.  
  61.             return resultList;
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement