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