I am trying to write a simple role playing game in C# to become more familiar with the language.
I have a class that loads data from CSV file, creates an object, and
Why not create a manager object responsible for reading data and returning instances of specified objects? Something like:
var actors = ActorsLoader.Load("actors.cvs");
where ActorsLoader.Load could be implemented as:
IEnumerable Load( string fileName )
{
//1. reading each line (each line = new actor) & creating actor object
//2. adding created actor object to a collection
//3. returning back a collection
}
I have assumed that each type of in-game objects are stored in separate files (so that you have: actors.csv, items.csv, skills.csv etc.)