/// <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>
        /// <exception cref="ArgumentNullException"><paramref name="reader"/> is null.</exception>
        public override void ReadCommand(MessageReader reader)
        {
            ThrowIfReaderNull(reader);

            MoveData   = new MoveVillageObjectMessageComponent();
            MoveData.X = reader.ReadInt32();
            MoveData.Y = reader.ReadInt32();
            MoveData.VillageObjectGameId = reader.ReadInt32();

            Unknown1 = reader.ReadInt32();
        }
Beispiel #2
0
        /// <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>
        /// <exception cref="ArgumentNullException"><paramref name="reader"/> is null.</exception>
        public override void ReadCommand(MessageReader reader)
        {
            ThrowIfReaderNull(reader);

            var count = reader.ReadInt32();

            if (count < 0)
            {
                throw new InvalidCommandException("Length of MovesData cannot be less than 0.", this);
            }

            MovesData = new MoveVillageObjectMessageComponent[count];
            for (int i = 0; i < count; i++)
            {
                var data = new MoveVillageObjectMessageComponent();
                data.X = reader.ReadInt32();
                data.Y = reader.ReadInt32();
                data.VillageObjectGameId = reader.ReadInt32();

                MovesData[i] = data;
            }

            Unknown1 = reader.ReadInt32();
        }