Repository navigation
Expand file tree
/
Copy pathInfocomContentCatalog.Community.Example.cs
More file actions
76 lines (71 loc) · 3.38 KB
/
Copy pathInfocomContentCatalog.Community.Example.cs
File metadata and controls
76 lines (71 loc) · 3.38 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
namespace _Project.Develop.StunGames.GameJam29.Runtime.Terminal.ContentPackage
{
internal static partial class InfocomContentCatalog
{
/*
* REFERENCE EXAMPLE
*
* This provider is not registered and does not add content to the game.
* Copy it to InfocomContentCatalog.Community.cs, rename it, and register
* the copy in AddCommunityContentTo as described in README.md.
*/
private sealed class KitchenBlockChiefPersonalTerminalContent : IInfocomContentProvider
{
public bool IsAvailable(TerminalContext context)
{
return true;
}
public void Register(
InfocomContentRegistrationContext registrationContext,
InfocomContentBuilder contentBuilder)
{
// The subnet and full address must describe the same location.
if (!registrationContext.IsSubnet("ch13.35")) return;
contentBuilder.AddNetworkDevice(
"ch13.35.01",
"KTCH-CHIEF",
"PERSONAL WORKSTATION",
// Open: connects without a password; remove the password argument below.
// Password: asks for a password; keep and edit the password argument below.
// Denied: visible through SWEEP/PING, but CONNECT is refused; remove the password argument.
StationNetworkAccessPolicy.Password,
device =>
{
// Create a folder before adding files inside it.
device.AddDirectory("messages", requireExistingParent: true);
device.AddDirectory("messages/archive", requireExistingParent: true);
// A file in the device root.
device.AddFile(
"profile.txt",
_ => new[]
{
"PERSONAL WORKSTATION",
string.Empty,
"Property of Chief",
string.Empty,
"<#E53525>STATUS: OVERDUE</color>"
},
requireExistingDirectory: true);
// A file inside a nested folder.
device.AddFile(
"messages/archive/shift_note.msg",
_ => new[]
{
"Bring spare coffee concentrate to the next shift.",
"Return the service adapter."
},
requireExistingDirectory: true);
// OPTIONAL: a visible file that always refuses READ.
// Remove this block if you do not need decorative locked content.
device.AddFile(
"messages/damaged.log",
_ => new[] { "RECOVERY FAILED" },
isReadable: false,
unreadableMessage: "FILE CORRUPTED",
requireExistingDirectory: true);
},
password: "example-password");
}
}
}
}