Exemple #1
0
 public void Draw(SpriteBatch spriteBatch)
 {
     if (inventoryItems.Count != 0)
     {
         foreach (KeyValuePair <PlayerItems, Rectangle> hudElement in inventoryItems)
         {
             if (LocationMapping.ContainsKey(hudElement.Key))
             {
                 spriteBatch.Draw(Texture, hudElement.Value, ItemMap[hudElement.Key], Color.White);
             }
         }
         if (Item != PlayerItems.None && !HasBowArrowCombo())
         {
             spriteBatch.Draw(Texture, CurrentItem, ItemMap[Item], Color.White);
         }
         else
         {
             DrawBowArrow(spriteBatch);
         }
     }
 }
Exemple #2
0
 public void AddItem(PlayerItems newItem)
 {
     if (!HasItem(newItem) && LocationMapping.ContainsKey(newItem) && inventoryItems.Count <= maxItems)
     {
         if (!itemToSecondaryItem.ContainsKey(newItem))
         {
             inventoryItems.Add(newItem, LocationMapping[newItem]);
         }
         else if (!secondaryItems.Contains(itemToSecondaryItem[newItem]))
         {
             secondaryItems.Add(itemToSecondaryItem[newItem]);
             inventoryItems.Add(newItem, LocationMapping[newItem]);
         }
         else
         {
             HandleSecondaryItem(newItem);
         }
     }
     else
     {
         HandleFairy(newItem);
     }
 }