class UI_TradeItem extends UIBaseItemRenderer {
	private winB: eui.Image;
	private winG: eui.Image;
	private winR: eui.Image;
	private winBr: eui.Image;
	private winRl: eui.Image;
	private winBg: eui.Image;
	private winText: eui.Label;
	private tradeName: eui.Label;
	private tradeEos: eui.Label;


	public constructor() {
		super();
	}

	/**
	 * 创建完成时调用
	 */
	protected onCreate(): void {
		super.onCreate();
	}

	//0:闲,1:庄,2:和,3:闲对,4:庄对
	protected dataChanged(): void {
		let lang = Lang.instance.lang();
		let {type,account,total} = this.data;
		let typaNames = ["player","banker","tie"]
		this.winB.visible = type ==0
		this.winR.visible = type ==1
		this.winG.visible = type ==2
		this.winBr.visible = type ==3
		this.winRl.visible = type ==4
		this.winText.text = lang.Rate[typaNames[type]];
		this.winBg.visible = type <=2;
		this.winBg.visible = type>2;
		this.tradeName.text = account;
		this.tradeEos.text = GAME_ISMOBILE ? total.replace(" EOS","") : total;
	}
}