public ValorRewardController() : base(0xEDC) { Name = "Rewards Controller"; Movable = false; Visible = false; MTitle = new TitleCollection(); _mValorItems = new ValorItemCollection(); Categories = new Dictionary <int, string> { { 0, "Titles" } }; if (_mInstance != null) { // there can only be one RewardController game stone in the world _mInstance.Location = Location; CommandHandlers.BroadcastMessage( AccessLevel.GameMaster, 0x489, "Existing Title Controller has been moved to this location (DON'T DELETE IT!)."); Timer.DelayCall(TimeSpan.FromSeconds(1), UpdateInstancePosition, this); } else { _mInstance = this; } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); MTitle = new TitleCollection(); _mValorItems = new ValorItemCollection(); switch (version) { case 2: { int categoryCount = reader.ReadInt(); if (categoryCount > 0) { Categories = new Dictionary <int, string>(); for (int i = 0; i < categoryCount; i++) { int num = reader.ReadInt(); string title = reader.ReadString(); Categories.Add(num, title); } } goto case 1; } case 1: { int count = reader.ReadInt(); if (count > 0) { for (int i = 0; i < count; i++) { var r = (ValorItem)reader.ReadItem(); _mValorItems.Add(r); } } goto case 0; } case 0: { int count = reader.ReadInt(); if (count > 0) { for (int i = 0; i < count; i++) { var r = (ValorTitleItem)reader.ReadItem(); MTitle.Add(r); } } } _mInstance = this; break; } }