source: OniSplit/Objects/PowerUp.cs@ 1115

Last change on this file since 1115 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: 900 bytes
Line 
1using System;
2using System.Xml;
3using Oni.Metadata;
4using Oni.Xml;
5
6namespace Oni.Objects
7{
8 internal class PowerUp : ObjectBase
9 {
10 public PowerUpClass Type;
11
12 public PowerUp()
13 {
14 TypeId = ObjectType.PowerUp;
15 }
16
17 protected override void WriteOsd(BinaryWriter writer)
18 {
19 writer.Write((uint)Type);
20 }
21
22 protected override void ReadOsd(BinaryReader reader)
23 {
24 Type = (PowerUpClass)reader.ReadUInt32();
25 }
26
27 protected override void WriteOsd(XmlWriter xml)
28 {
29 xml.WriteElementString("Class", MetaEnum.ToString<PowerUpClass>(Type));
30 }
31
32 protected override void ReadOsd(XmlReader xml, ObjectLoadContext context)
33 {
34 Type = xml.ReadElementContentAsEnum<PowerUpClass>("Class");
35 }
36 }
37}
Note: See TracBrowser for help on using the repository browser.