forked from cbluoss/OpenHacknet
/
PeopleAssets.cs
69 lines (63 loc) · 2.1 KB
/
PeopleAssets.cs
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
namespace Hacknet
{
internal class PeopleAssets
{
private static readonly string[] degreeTitles = new string[3]
{
"Bachelor of ",
"Masters in ",
"PHD in "
};
private static readonly string[] degreeNames = new string[12]
{
"Computer Science",
"Buisness",
"Electrical Engineering",
"Finance",
"Marketing",
"The Arts",
"Computer Graphics",
"Design",
"Medicine",
"Pharmacy",
"Information Technology",
"Psychology"
};
private static readonly string[] hackerDegreeNames = new string[5]
{
"Computer Science",
"Digital Security",
"Computer Networking",
"Information Technology",
"Computer Graphics"
};
public static Degree getRandomDegree(WorldLocation origin)
{
var degree = new Degree();
degree.name = randOf(degreeTitles) + randOf(degreeNames);
degree.GPA = (float) (3.0 + 3.0*(Utils.random.NextDouble() - 0.5)*0.5);
while (degree.GPA > 4.0)
degree.GPA -= Utils.randm(0.4f);
degree.uni = "University of " + origin.name;
if (Utils.flipCoin())
degree.uni = origin.name + " University";
return degree;
}
public static Degree getRandomHackerDegree(WorldLocation origin)
{
var degree = new Degree();
degree.name = randOf(degreeTitles) + randOf(hackerDegreeNames);
degree.GPA = (float) (3.0 + 5.0*(Utils.random.NextDouble() - 0.5)*0.5);
degree.uni = "University of " + origin.name;
if (Utils.flipCoin())
degree.uni = origin.name + " University";
return degree;
}
public static string randOf(string[] array)
{
var index = (int) (Math.Max(0.0001, Utils.random.NextDouble())*array.Length - 1.0);
return array[index];
}
}
}