ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/OniSplit/Particles/VariableReference.cs
Revision: 1114
Committed: Wed Jan 22 14:08:57 2020 UTC (5 years, 8 months ago) by iritscen
File size: 749 byte(s)
Log Message:
Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File Contents

# Content
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 }