ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/OniSplit/Objects/Weapon.cs
Revision: 1114
Committed: Wed Jan 22 14:08:57 2020 UTC (5 years, 8 months ago) by iritscen
File size: 824 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 using System;
2 using System.Xml;
3
4 namespace Oni.Objects
5 {
6 internal class Weapon : ObjectBase
7 {
8 public string ClassName;
9
10 public Weapon()
11 {
12 TypeId = ObjectType.Weapon;
13 }
14
15 protected override void WriteOsd(BinaryWriter writer)
16 {
17 writer.Write(ClassName, 32);
18 }
19
20 protected override void ReadOsd(BinaryReader reader)
21 {
22 ClassName = reader.ReadString(32);
23 }
24
25 protected override void WriteOsd(XmlWriter xml)
26 {
27 xml.WriteElementString("Class", ClassName);
28 }
29
30 protected override void ReadOsd(XmlReader xml, ObjectLoadContext context)
31 {
32 ClassName = xml.ReadElementContentAsString("Class", "");
33 }
34 }
35 }