예제 #1
0
        public static InventoryCard ReadNew(BinaryReader r)
        {
            var           cardId = new CardId(r.ReadUInt32());
            InventoryCard card   = cardId.Type switch
            {
                CardType.Item => new InventoryItem(),
                CardType.Spell => new InventorySpell(),
                CardType.Fairy => new InventoryFairy(),
                _ => throw new InvalidDataException($"Invalid inventory card type: {cardId.Type}")
            };

            card.cardId  = cardId;
            card.atIndex = r.ReadUInt32();
            card.dbUID   = UID.ReadNew(r);
            card.amount  = r.ReadUInt32();
            card.isInUse = r.ReadBoolean();
            card.ReadSub(r);
            return(card);
        }
예제 #2
0
 public static ForeignKey ReadNew(BinaryReader reader)
 {
     return(new ForeignKey(UID.ReadNew(reader), UID.ReadNew(reader)));
 }
예제 #3
0
 public ForeignKey(UID uid = new UID(), UID type = new UID())
 {
     this.uid  = uid;
     this.type = type;
 }