using UnityEditor.Graphs;
using UnityEngine;
///
/// This class holds data for an Item. Currently it has a name, an iconName and a base price.
///
public abstract class Item
{
public readonly string name;
public readonly string iconName;
public readonly string description;
public readonly ItemRarity rarity;
public int basePrice { get; private set; } // This is the base price for the item, the buying and selling prices can be
// generated based on this value.
//------------------------------------------------------------------------------------------------------------------------
// Item()
//------------------------------------------------------------------------------------------------------------------------
public Item(string name, string iconName, int pbasePrice, string itemDescr = "")
{
this.name = name;
this.iconName = iconName;
this.basePrice = pbasePrice;
description = itemDescr;
rarity = ItemRarity.UltraRare;
}
// This is supposed to return what type an item identifies as, purely used for filtering
public abstract ItemType GetItemType();
// Returns a nicely formatted text about the item's stats. Implementation-specific, because different types of items generate these differently
public abstract string GetStats();
}
///
/// Item type, mostly used as an identifier for item filters
///
public enum ItemType
{
Weapon,
Armor,
Potion
}
public enum ItemRarity : uint // Int representing color, so that this enum not only works as an identifier, but also contains name and col in just 32 bits. C#-Magic!
{
Common = 0xFFFFFFFF,
Uncommon = 0xFFFF00FF,
Rare = 0xFF0000FF,
UltraRare = 0xFF00FFFF,
Unique = 0x00FF00FF
}