﻿using System.Collections.Generic;

namespace Unity.Muninn.Model
{
    public class MuninnPlayer
    {
        public string Id { get; set; }
        
        public string Name { get; set; }
        
        public Dictionary<string, string> Properties { get; set; }
        
        public uint SenderId { get; set; }
        
        
        public static MuninnPlayer toModel(Unity.Muninn.Message.MuninnPlayer player)
        {                
            MuninnPlayer res = new MuninnPlayer();
            res.Id = player.UniqueId;
            res.Name = player.Name;
            res.SenderId = player.Id;
            res.Properties = new Dictionary<string, string>();
            foreach (var item in player.Properties)
            {
                res.Properties.Add(item.Key, item.Value);
            }

            return res;
        }
        
    }
}