Exemple #1
0
 public void AddGemItem(gem item)
 {
     if (capacity >= current + item.Value && GoldItemsValue >= GemItemsValue + item.Value)
     {
         var gemItems = GetGemItems();
         if (gemItems.Any(gi => gi.Key == item.Key))
         {
             gemItems.Single(gi => gi.Key == item.Key).IncreaseValue(item.Value);
         }
         else
         {
             bag1.Add(item);
         }
         current += item.Value;
     }
 }
Exemple #2
0
 private static void InsertItem(string key, long value, bag bag)
 {
     if (key.Length == 3)
     {
         cash cash = new cash(key, value);
         bag.AddCashItem(cash);
     }
     else if (key.Length >= 4 && key.ToLower().EndsWith("gem"))
     {
         gem gem = new gem(key, value);
         bag.AddGemItem(gem);
     }
     else if (key.ToLower().Equals("gold"))
     {
         gold gold = new gold(key, value);
         bag.AddGoldItem(gold);
     }
 }
Exemple #3
0
 set => SetGemCoord(gem, value);
Exemple #4
0
 Find(gem, line, methodTwo, 1);
Exemple #5
0
 Find(gem, line, methodOne, 1);