1 |
namespace Oni.Particles |
2 |
{ |
3 |
internal class VariableReference |
4 |
{ |
5 |
public const int ByteSize = 24; |
6 |
public static readonly VariableReference Empty = new VariableReference(string.Empty); |
7 |
|
8 |
private string name; |
9 |
|
10 |
public VariableReference(string name) |
11 |
{ |
12 |
this.name = name; |
13 |
} |
14 |
|
15 |
public VariableReference(BinaryReader reader) |
16 |
{ |
17 |
name = reader.ReadString(16); |
18 |
reader.Skip(8); |
19 |
} |
20 |
|
21 |
public void Write(BinaryWriter writer) |
22 |
{ |
23 |
writer.Write(name, 16); |
24 |
writer.Skip(8); |
25 |
} |
26 |
|
27 |
public bool IsDefined => !string.IsNullOrEmpty(name); |
28 |
|
29 |
public string Name => name; |
30 |
} |
31 |
} |