class UI_RateTypeItem extends UIBaseItemRenderer {
	private typeCount: eui.Label;
	private winR: eui.Image;
	private winB: eui.Image;
	private winG: eui.Image;
	private winRl: eui.Image;
	private winBr: eui.Image;
	private winText: eui.Label;

	public constructor() {
		super();
	}

	/**
	 * 创建完成时调用
	 */
	protected onCreate(): void {
		super.onCreate();
	}
	protected dataChanged(): void {
		let lang = Lang.instance.lang();
		let typeArr = ["winR","winB","winG","winRl","winBr"];
		let typeNames = ["banker","player","tie","bankerPair","playerPair"];
		let labelName = lang.Rate[typeNames[this.itemIndex]]
		
		typeArr.forEach((item)=>{
			this[item].visible = false;
		})

		this.winText.text = labelName;
		this.winText.visible = this.itemIndex==0 || this.itemIndex==1 || this.itemIndex==2;
		this[typeArr[this.itemIndex]].visible = true;
		this.typeCount.text = `${labelName}\n${this.data}`;
	}
}