using System; using System.Collections.Generic; public class NimbleBridge_MockDataStorage { #if UNITY_EDITOR || ( ! UNITY_IPHONE && ! UNITY_ANDROID ) public class MTXCatalogItem { public string Sku {get; set;} public string Title {get; set;} public string Description {get; set;} public float PriceDecimal {get; set;} public string PriceWithCurrencyAndFormat {get; set;} public NimbleBridge_MTXCatalogItem.Type ItemType {get; set;} public string MetaDataUrl {get; set;} public string AdditionalInfo {get; set;} public MTXCatalogItem() { } public MTXCatalogItem(string sku, string title, string description, float priceDecimal, string priceWithCurrencyAndFormat, NimbleBridge_MTXCatalogItem.Type itemType, string metaDataUrl, string additionalInfo) { this.Sku = sku; this.Title = title; this.Description = description; this.PriceDecimal = priceDecimal; this.PriceWithCurrencyAndFormat = priceWithCurrencyAndFormat; this.ItemType = itemType; this.MetaDataUrl = metaDataUrl; this.AdditionalInfo = additionalInfo; } } static private NimbleBridge_MockDataStorage s_instance; static public NimbleBridge_MockDataStorage Get() { if (s_instance == null) { s_instance = new NimbleBridge_MockDataStorage(); } return s_instance; } private NimbleBridge_MockDataStorage() { m_mtxCatalogItems = new Dictionary(); s_nextMTXCatalogItemId = 0; } private Dictionary m_mtxCatalogItems; static private uint s_nextMTXCatalogItemId; public uint AddMTXCatalogItem(MTXCatalogItem mtxCatalogItem) { m_mtxCatalogItems.Add(++s_nextMTXCatalogItemId, mtxCatalogItem); return s_nextMTXCatalogItemId; } public MTXCatalogItem GetMTXCatalogItem(uint mtxCatalogItemId) { MTXCatalogItem mtxCatalogItem; m_mtxCatalogItems.TryGetValue(mtxCatalogItemId, out mtxCatalogItem); return mtxCatalogItem; } public List GetMTXCatalogItemIds() { List keyList = new List(m_mtxCatalogItems.Keys); return keyList; } #endif }