public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadEncodedInt(); MCT = new MiniCarouselTimer(this); if (Dolls == null) { Dolls = new List <CarouselDoll>(); } if (Lights == null) { Lights = new List <CarouselDoll>(); } int counter = reader.ReadInt(); for (int i = 0; i < counter; i++) { CarouselDoll doll = (CarouselDoll)reader.ReadItem(); Dolls.Add(doll); } counter = reader.ReadInt(); for (int i = 0; i < counter; i++) { CarouselDoll light = (CarouselDoll)reader.ReadItem(); Lights.Add(light); } }
public void AddDolls() { for (int i = 0; i < 4; i++) { Point3D offset; CarouselDoll doll; CarouselDoll light; switch (i) { case 0: { offset = new Point3D(-1, 0, 8); doll = new CarouselDoll(0x259B, 0xE9, offset, "Carousel Doll", this); offset = new Point3D(-1, 0, 17); light = new CarouselDoll(3854, 0x16, offset, "Carousel Light", this); Dolls.Add(doll); Lights.Add(light); break; } case 1: { offset = new Point3D(-1, -1, 8); doll = new CarouselDoll(0x259A, 0x12, offset, "Carousel Doll", this); offset = new Point3D(-1, -1, 17); light = new CarouselDoll(3854, 0x2, offset, "Carousel Light", this); Dolls.Add(doll); Lights.Add(light); break; } case 2: { offset = new Point3D(-2, -1, 7); doll = new CarouselDoll(0x259A, 0x3, offset, "Carousel Doll", this); Dolls.Add(doll); break; } case 3: { offset = new Point3D(-2, 0, 8); doll = new CarouselDoll(0x259B, 0x16F, offset, "Carousel Doll", this); offset = new Point3D(-2, 0, 17); light = new CarouselDoll(3854, 0x43, offset, "Carousel Light", this); Dolls.Add(doll); Lights.Add(light); break; } default: { break; } } } UpdatePosition(); }