I have a class that is as follows:
public class Item
{
private int _ItemID;
private string _ItemName;
private string _ItemDescription;
private TypeItem _ItemType;
private Dice _ItemDice;
public int ItemID { get { return _ItemID; } set { _ItemID = value; } }
public string ItemName { get { return _ItemName; } set { _ItemName = value; } }
public string ItemDescription { get { return _ItemDescription; } set { _ItemDescription = value; } }
public TypeItem ItemType { get { return _ItemType; } set { _ItemType = value; } }
public Dice ItemDice { get { return _ItemDice; } set { _ItemDice = value; } }
public Item (int ID, string Name, string Description, TypeItem Type, Dice DiceType)
{
ItemID = ID;
ItemName = Name;
ItemDescription = Description;
ItemType = Type;
ItemDice = DiceType;
}
}
And then a text-file that is as follows:
//ID,"Name","Description",Type,Dice,Modifier,Value;
1,"Dagger","A short blade",Blade,d4,1,5;
2,"Short Sword","An average length blade",Blade,d6,1,7,5;
3,"Long Sword","A long blade",Blade,d8,1,10;
What I want to learn, is how to separate each individual string of data in-between the commas, and assign it to a variable of an item, inside a list of items.