using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class Player {
    public bool Active = true;
    private uint money = Game.STARTING_CURRENCY;
    public uint Money {
        get { return money; }
        set {
            money = value;
            SetText();
        }
    }
    public string Username;
    public List<Tower> Towers;
    public Color Color;
    public TextMeshProUGUI Text;
    public Player(string username, TextMeshProUGUI text, Color color) {
        Username = username;
        Text = text;
        Color = color;
        Towers = new List<Tower>();
        SetText();
    }

    void SetText() {
        Text.text = $"<color=#{ColorUtility.ToHtmlStringRGB(Color)}>{Username}</color>" +
            $" (<color=#FFFF55>{Money}</color>)";
    }
}
