forked from jefetienne/daggerfall-unity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBioFile.cs
More file actions
47 lines (42 loc) · 1.24 KB
/
BioFile.cs
File metadata and controls
47 lines (42 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Project: Daggerfall Tools For Unity
// Copyright: Copyright (C) 2009-2020 Daggerfall Workshop
// Web Site: http://www.dfworkshop.net
// License: MIT License (http://www.opensource.org/licenses/mit-license.php)
// Source Code: https://github.com/Interkarma/daggerfall-unity
// Original Author: Numidium
// Contributors:
//
// Notes:
//
using System.IO;
using System.Collections.Generic;
namespace DaggerfallConnect.Arena2
{
/// <summary>
/// Connects to a Daggerfall BIO.DAT file and extracts the player biography text.
/// </summary>
public class BioFile
{
public BioFile()
{
Lines = new List<string>();
}
public bool Load(string filePath)
{
StreamReader reader = new StreamReader(filePath);
if (reader == null)
{
return false;
}
string text = reader.ReadToEnd();
reader.Close();
string[] textLines = text.Split(new char[] { '\0' });
for (int i = 0; i < textLines.Length; i++)
{
Lines.Add(textLines[i]);
}
return true;
}
public List<string> Lines { get; set; }
}
}