Client LuaCsForBarotrauma
TrimLString.cs
1
#nullable enable
2
using
System;
3
4
namespace
Barotrauma
5
{
6
public
class
TrimLString
:
LocalizedString
7
{
8
[Flags]
9
public
enum
Mode
{
Start
= 0x1, End = 0x2,
Both
=0x3 }
10
private
readonly
LocalizedString
nestedStr;
11
private
readonly
Mode
mode;
12
13
public
TrimLString
(
LocalizedString
nestedStr,
Mode
mode)
14
{
15
this.nestedStr = nestedStr;
16
this.mode = mode;
17
}
18
19
public
override
bool
Loaded
=> nestedStr.Loaded;
20
public
override
void
RetrieveValue
()
21
{
22
cachedValue
= nestedStr.Value;
23
if
(mode.HasFlag(
Mode
.Start)) {
cachedValue
=
cachedValue
.TrimStart(); }
24
if
(mode.HasFlag(
Mode
.End)) {
cachedValue
=
cachedValue
.TrimEnd(); }
25
UpdateLanguage
();
26
}
27
}
28
}
Barotrauma.LocalizedString
Definition:
LocalizedString.cs:8
Barotrauma.LocalizedString.cachedValue
string cachedValue
Definition:
LocalizedString.cs:19
Barotrauma.LocalizedString.UpdateLanguage
void UpdateLanguage()
Definition:
LocalizedString.cs:33
Barotrauma.TrimLString
Definition:
TrimLString.cs:7
Barotrauma.TrimLString.RetrieveValue
override void RetrieveValue()
Definition:
TrimLString.cs:20
Barotrauma.TrimLString.Loaded
override bool Loaded
Definition:
TrimLString.cs:19
Barotrauma.TrimLString.Mode
Mode
Definition:
TrimLString.cs:9
Barotrauma.TrimLString.TrimLString
TrimLString(LocalizedString nestedStr, Mode mode)
Definition:
TrimLString.cs:13
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma.CirclePhase.Start
@ Start
Barotrauma.CharacterType.Both
@ Both
Barotrauma
BarotraumaShared
SharedSource
Text
LocalizedString
TrimLString.cs
Generated by
1.9.1