using Fiesta.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fiesta.Worlds
{
	public sealed class World
	{
		public enum WorldStatus : byte
		{
			Offline = 0x00,
			Maintenance = 0x01,
			Empty = 0x02,
			Reserved = 0x03,
			UnknownError = 0x04,
			Full = 0x05,
			Low = 0x06,
			// Low = 0x07,
			// Low = 0x08,
			Medium = 0x09,
			High = 0x0A
		}

		public byte ID;
		private string _name;
		public string Name {
			get => _name;
			set => _name = ((value.Length > 16) ? value.Substring(0, 16) : value);
		}
		public WorldStatus Status = WorldStatus.Offline;

		public ServerInfo.WorldServerInfo WorldServerInfo;

		public World(ServerInfo.WorldServerInfo worldServerInfo)
		{
			WorldServerInfo = worldServerInfo;

			ID = worldServerInfo.ID;
			Name = worldServerInfo.Name;
		}
	}
}