Client LuaCsForBarotrauma
SubmarineFile.cs
1
using
System;
2
using
System.Security.Cryptography;
3
4
namespace
Barotrauma
5
{
6
public
abstract
class
BaseSubFile
:
ContentFile
7
{
8
protected
BaseSubFile
(
ContentPackage
contentPackage,
ContentPath
path) : base(contentPackage, path)
9
{
10
using
var md5 = MD5.Create();
11
#warning TODO: this doesn't account for collisions, this should probably be using the PrefabCollection class like everything else
12
UintIdentifier
= ToolBoxCore.StringToUInt32Hash(
Barotrauma
.
IO
.
Path
.GetFileNameWithoutExtension(path.
Value
), md5);
13
}
14
15
public
readonly UInt32
UintIdentifier
;
16
17
public
override
void
LoadFile
()
18
{
19
SubmarineInfo
.
RefreshSavedSub
(Path.Value);
20
}
21
22
public
override
void
UnloadFile
()
23
{
24
SubmarineInfo
.
RemoveSavedSub
(Path.Value);
25
}
26
27
public
override
void
Sort
()
28
{
29
//Overrides for subs don't exist! Should we change this?
30
}
31
32
// Use byte-perfect hash because this is compressed, trimming whitespace is incorrect and needlessly slow here
33
public
override
Md5Hash
CalculateHash
()
34
=>
Md5Hash
.
CalculateForFile
(Path.FullPath,
Md5Hash
.
StringHashOptions
.BytePerfect);
35
}
36
37
[
NotSyncedInMultiplayer
]
38
public
class
SubmarineFile
:
BaseSubFile
39
{
40
public
SubmarineFile
(
ContentPackage
contentPackage,
ContentPath
path) : base(contentPackage, path) { }
41
}
42
}
Barotrauma.BaseSubFile
Definition:
SubmarineFile.cs:7
Barotrauma.BaseSubFile.BaseSubFile
BaseSubFile(ContentPackage contentPackage, ContentPath path)
Definition:
SubmarineFile.cs:8
Barotrauma.BaseSubFile.UintIdentifier
readonly UInt32 UintIdentifier
Definition:
SubmarineFile.cs:15
Barotrauma.BaseSubFile.LoadFile
override void LoadFile()
Definition:
SubmarineFile.cs:17
Barotrauma.BaseSubFile.Sort
override void Sort()
Definition:
SubmarineFile.cs:27
Barotrauma.BaseSubFile.UnloadFile
override void UnloadFile()
Definition:
SubmarineFile.cs:22
Barotrauma.BaseSubFile.CalculateHash
override Md5Hash CalculateHash()
Barotrauma.ContentFile
Base class for content file types, which are loaded from filelist.xml via reflection....
Definition:
ContentFile.cs:23
Barotrauma.ContentPackage
Definition:
ContentPackage.cs:18
Barotrauma.ContentPath
Definition:
ContentPath.cs:11
Barotrauma.ContentPath.Value
string???????????? Value
Definition:
ContentPath.cs:27
Barotrauma.IO.Path
Definition:
SafeIO.cs:209
Barotrauma.Md5Hash
Definition:
Md5Hash.cs:13
Barotrauma.Md5Hash.StringHashOptions
StringHashOptions
Definition:
Md5Hash.cs:108
Barotrauma.Md5Hash.CalculateForFile
static Md5Hash CalculateForFile(string path, StringHashOptions options)
Definition:
Md5Hash.cs:114
Barotrauma.NotSyncedInMultiplayer
Definition:
ContentFile.cs:13
Barotrauma.SubmarineFile
Definition:
SubmarineFile.cs:39
Barotrauma.SubmarineFile.SubmarineFile
SubmarineFile(ContentPackage contentPackage, ContentPath path)
Definition:
SubmarineFile.cs:40
Barotrauma.SubmarineInfo
Definition:
BarotraumaShared/SharedSource/Map/SubmarineInfo.cs:31
Barotrauma.SubmarineInfo.RemoveSavedSub
static void RemoveSavedSub(string filePath)
Definition:
BarotraumaShared/SharedSource/Map/SubmarineInfo.cs:667
Barotrauma.SubmarineInfo.RefreshSavedSub
static void RefreshSavedSub(string filePath)
Definition:
BarotraumaShared/SharedSource/Map/SubmarineInfo.cs:679
Barotrauma.IO
Definition:
SafeIO.cs:14
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma
BarotraumaShared
SharedSource
ContentManagement
ContentFile
SubmarineFile.cs
Generated by
1.9.1