// Copyright © 2017-2018 Atomic Software, LLC. All Rights Reserved.
// See LICENSE.md for full license information.

using Atom.Core.Collections;
using Atom.Core.Local;
using System.Linq;

namespace Atom.Core.Networking.Messages.Structures.User
{
    public sealed class PROTO_NC_USER_WORLD_STATUS_ACK : NetworkMessage
    {
        public PROTO_NC_USER_WORLD_STATUS_ACK(List<World> worlds) : base(MessageProtocol.NC_USER_WORLD_STATUS_ACK)
        {
            Write((byte) worlds.Count);

            foreach (var World in worlds.OrderBy(x => x.Number))
            {
                Write(World);
            }
        }
    }
}
