public TradingInventoryController(NpcConversationStaticData p_data, Npc p_npc)
 {
     m_offers            = new List <TradingItemOffer>();
     m_inventory         = new Inventory(ConfigManager.Instance.Game.TradingInventorySize);
     m_inventory.isOffer = true;
     m_npc = p_npc;
     if (p_data.m_offers != null)
     {
         foreach (NpcConversationStaticData.Offer offer in p_data.m_offers)
         {
             TradingItemOffer item = new TradingItemOffer(offer.m_id, offer.m_conditions);
             m_offers.Add(item);
         }
     }
 }
        public void Load(SaveGameData p_data)
        {
            Int32 num = p_data.Get <Int32>("OfferCount", 0);

            for (Int32 i = 0; i < num; i++)
            {
                Int32            p_staticID = p_data.Get <Int32>("OfferID" + i, 1);
                TradingItemOffer offerById  = GetOfferById(p_staticID);
                if (offerById != null)
                {
                    SaveGameData saveGameData = p_data.Get <SaveGameData>("Offer" + i, null);
                    if (saveGameData != null)
                    {
                        offerById.Load(saveGameData);
                    }
                }
            }
        }