public void RemoveFromInventory(ShopsFlags shop, Item i) { foreach (var s in shops) { if ((shop & s) == s) { StoresDict[s][i.Offset] = false; } } }
public void AddToInventory(ShopsFlags shop, Item i) { foreach (var s in shops) { if ((shop & s) == s) { StoresDict[s][i.Offset] = true; } } }
public StoreInventory(Context context, ShopsFlags whichStore, IList <byte> bytes) { WhichStore = whichStore; ourContext = context; itemsList = context == Context.US_PSP ? Item.PSPDummies.Sub(0, 255) : Item.PSXDummies; for (int i = 0; i < 256; i++) { UInt16 currentShort = (UInt16)(bytes[i * 2] * 256 + bytes[i * 2 + 1]); items[itemsList[i]] = (currentShort & (int)whichStore) > 0; } name = context == Context.US_PSP ? PSPResources.Lists.ShopNames[whichStore] : PSXResources.Lists.ShopNames[whichStore]; }
public ShopsFlags this[Item i] { get { ShopsFlags result = ShopsFlags.Empty; foreach (var s in Stores) { if (s[i.Offset]) { result |= s.WhichStore; } } return(result); } set { foreach (var s in shops) { StoresDict[s][i.Offset] = ((value & s) == s); } } }
public StoreInventory(Context context, ShopsFlags whichStore, IList <byte> bytes, IList <byte> defaultBytes) : this(context, whichStore, bytes) { Default = new StoreInventory(context, whichStore, defaultBytes); }