using UnityEngine;
using NeonTea.Quakeball.Game;
using NeonTea.Quakeball.Players;

namespace NeonTea.Quakeball.Networking {
    public class NetPlayer {
        private Player _Controlled;
        private ulong _Id;

        public ulong Id {
            get { return _Id; }
            set {
                _Id = value;
                if (_Controlled != null) {
                    _Controlled.NetId = _Id;
                }
            }
        }
        public Player Controlled {
            get { return _Controlled; }
            set {
                _Controlled = value;
                if (_Controlled != null) {
                    _Controlled.NetId = _Id;
                }
            }
        }
        public string Nick;
        public Team Team = Team.FreeForAll;
        public bool Unsynced = false;
        public float Ping = 0;

        public NetPlayer(ulong id, Player obj = null) {
            Id = id;
            Controlled = obj;
            Nick = id.ToString();
        }
    }
}