Could someone explain how to write multiple values with different value types to a CSV file. I gather you have to use a Stream writer, but how do i prepare the values before writing to the file?
public static void SaveGame(GridReference[] TrapPositions, GridReference MonsterPosition, GridReference PlayerPosition, GridReference FlaskPosition, bool MonsterAwake)
{
//StreamWriter sw = new StreamWriter (filename);
/* string filePath = "path" + "filename.csv";
if (!File.Exists(filePath))
{
File.Create(filePath).Close();
} */
string delimiter = ",";
int PlayerX = PlayerPosition.X_CoOrd;
int PlayerY = PlayerPosition.Y_CoOrd;
bool Awake = MonsterAwake;
int FirstTrapX = TrapPositions [1].X_CoOrd;
int FirsttrapY = TrapPositions [1].Y_CoOrd;
int SecondTrapX = TrapPositions [2].X_CoOrd;
int SecondTrapY = TrapPositions [2].Y_CoOrd;
int MonsterX = MonsterPosition.X_CoOrd;
int MonsterY = MonsterPosition.Y_CoOrd;
int FlaskX = FlaskPosition.X_CoOrd;
int FlaskY = FlaskPosition.Y_CoOrd;
}