Merge sprechtl develop

This commit is contained in:
s-prechtl 2022-06-09 00:00:26 +02:00
commit f8da73695c
4 changed files with 45 additions and 16 deletions

View file

@ -5,19 +5,26 @@ using UnityEngine;
public class Item : ScriptableObject, IComparable<Item> {
public string displayName;
public string description;
public int id; //TODO: create an actual ID System that makes snens
private int _id = -1;
public Sprite selectedSprite;
public Sprite defaultSprite;
public int price;
public int SellPrice => Convert.ToInt32(price * 0.8);
ic int ID => _id;
public Item(string displayName, string description, int id) {
this.displayName = displayName;
this.description = description;
this.id = id;
this._id = id;
}
public int CompareTo(Item other) {
return this.id - other.id;
return this._id - other._id;
}
public void SetID(int id) {
if (_id != -1) {
_id = id;
}
}
}