Last change
on this file since 1171 was 1114, checked in by iritscen, 5 years ago |
Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1114] | 1 | namespace Oni.Particles
|
---|
| 2 | {
|
---|
| 3 | internal class Variable
|
---|
| 4 | {
|
---|
| 5 | private string name;
|
---|
| 6 | private StorageType storageType;
|
---|
| 7 | private Value value;
|
---|
| 8 | private int storageOffset;
|
---|
| 9 |
|
---|
| 10 | public Variable(string name, StorageType type, Value value)
|
---|
| 11 | {
|
---|
| 12 | this.name = name;
|
---|
| 13 | this.storageType = type;
|
---|
| 14 | this.value = value;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | public Variable(BinaryReader reader)
|
---|
| 18 | {
|
---|
| 19 | name = reader.ReadString(16);
|
---|
| 20 | storageType = (StorageType)reader.ReadInt32();
|
---|
| 21 | storageOffset = reader.ReadInt32();
|
---|
| 22 | value = Value.Read(reader);
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public void Write(BinaryWriter writer)
|
---|
| 26 | {
|
---|
| 27 | writer.Write(name, 16);
|
---|
| 28 | writer.Write((int)storageType);
|
---|
| 29 | writer.Write(0);
|
---|
| 30 | value.Write(writer);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | public string Name => name;
|
---|
| 34 |
|
---|
| 35 | public StorageType StorageType => storageType;
|
---|
| 36 |
|
---|
| 37 | public int StorageOffset => storageOffset;
|
---|
| 38 |
|
---|
| 39 | public Value Value => value;
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.