/// <summary> /// Reads the <see cref="MoveVillageObjectCommand"/> from the specified <see cref="MessageReader"/>. /// </summary> /// <param name="reader"> /// <see cref="MessageReader"/> that will be used to read the <see cref="MoveVillageObjectCommand"/>. /// </param> public override void ReadCommand(MessageReader reader) { MoveData = new MoveVillageObjectData(); MoveData.X = reader.ReadInt32(); MoveData.Y = reader.ReadInt32(); MoveData.VillageObjectGameIndex = reader.ReadInt32(); Unknown1 = reader.ReadInt32(); }
/// <summary> /// Reads the <see cref="MoveVillageObjectCommand"/> from the specified <see cref="MessageReader"/>. /// </summary> /// <param name="reader"> /// <see cref="MessageReader"/> that will be used to read the <see cref="MoveVillageObjectCommand"/>. /// </param> public override void ReadCommand(MessageReader reader) { var count = reader.ReadInt32(); if (count < 0) throw new InvalidCommandException("Number of MovesData cannot be less than 0.", this); MovesData = new MoveVillageObjectData[count]; for (int i = 0; i < count; i++) { var data = new MoveVillageObjectData(); data.X = reader.ReadInt32(); data.Y = reader.ReadInt32(); data.VillageObjectGameIndex = reader.ReadInt32(); MovesData[i] = data; } Unknown1 = reader.ReadInt32(); }