예제 #1
0
 public void RemoveFromInventory(ShopsFlags shop, Item i)
 {
     foreach (var s in shops)
     {
         if ((shop & s) == s)
         {
             StoresDict[s][i.Offset] = false;
         }
     }
 }
예제 #2
0
 public void AddToInventory(ShopsFlags shop, Item i)
 {
     foreach (var s in shops)
     {
         if ((shop & s) == s)
         {
             StoresDict[s][i.Offset] = true;
         }
     }
 }
예제 #3
0
 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];
 }
예제 #4
0
 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);
         }
     }
 }
예제 #5
0
 public StoreInventory(Context context, ShopsFlags whichStore, IList <byte> bytes, IList <byte> defaultBytes)
     : this(context, whichStore, bytes)
 {
     Default = new StoreInventory(context, whichStore, defaultBytes);
 }