using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using wf;

public class YotogiParamBasicBar : MonoBehaviour
{
	public virtual void Awake()
	{
		if (0 < this.bar_dic_.Count)
		{
			return;
		}
		YotogiParamBasicBar.BarSet barSet = new YotogiParamBasicBar.BarSet();
		barSet.min = -100;
		barSet.max = 300;
		barSet.gauge_trans = UTY.GetChildObject(base.gameObject, "Excited/GaugeGroup/Gauge", false).transform;
		barSet.num_label = UTY.GetChildObject(base.gameObject, "Excited/Value", false).GetComponent<UILabel>();
		this.bar_dic_.Add(YotogiParamBasicBar.Kind.Excite, barSet);
		YotogiParamBasicBar.BarSet barSet2 = new YotogiParamBasicBar.BarSet();
		barSet2.min = 0;
		barSet2.max = 100;
		barSet2.gauge_trans = UTY.GetChildObject(base.gameObject, "Mind/GaugeGroup/Gauge", false).transform;
		barSet2.num_label = UTY.GetChildObject(base.gameObject, "Mind/Value", false).GetComponent<UILabel>();
		this.bar_dic_.Add(YotogiParamBasicBar.Kind.Mind, barSet2);
		YotogiParamBasicBar.BarSet barSet3 = new YotogiParamBasicBar.BarSet();
		barSet3.min = 0;
		barSet3.max = 300;
		barSet3.gauge_trans = UTY.GetChildObject(base.gameObject, "Reason/GaugeGroup/Gauge", false).transform;
		barSet3.num_label = UTY.GetChildObject(base.gameObject, "Reason/Value", false).GetComponent<UILabel>();
		this.bar_dic_.Add(YotogiParamBasicBar.Kind.Sensual, barSet3);
		this.color_dic_.Add(YotogiParamBasicBar.GageColor.Blue, new Color(0f, 0.5f, 1f));
		this.color_dic_.Add(YotogiParamBasicBar.GageColor.Red, new Color(1f, 0f, 0f));
		this.color_dic_.Add(YotogiParamBasicBar.GageColor.Yellow, new Color(1f, 1f, 0f));
		this.color_dic_.Add(YotogiParamBasicBar.GageColor.Orange, new Color(1f, 0.5f, 0f));
		this.color_dic_.Add(YotogiParamBasicBar.GageColor.Pink, new Color(1f, 0f, 0.5f));
	}

	public void SetMaid(Maid maid)
	{
		this.maid_ = maid;
	}

	public void SetMaxMind(int max_num)
	{
		this.bar_dic_[YotogiParamBasicBar.Kind.Mind].max = max_num;
	}

	public virtual void SetCurrentExcite(int cur_num, bool is_anime)
	{
		YotogiParamBasicBar.BarSet barSet = this.bar_dic_[YotogiParamBasicBar.Kind.Excite];
		barSet.num_label.text = cur_num.ToString();
		float num = (float)(cur_num + barSet.min * -1) / (float)barSet.max;
		num -= 0.333333343f;
		Color color;
		if (200 <= cur_num)
		{
			color = this.color_dic_[YotogiParamBasicBar.GageColor.Red];
		}
		else if (100 <= cur_num)
		{
			color = this.color_dic_[YotogiParamBasicBar.GageColor.Orange];
		}
		else if (0 <= cur_num)
		{
			color = this.color_dic_[YotogiParamBasicBar.GageColor.Yellow];
		}
		else
		{
			color = this.color_dic_[YotogiParamBasicBar.GageColor.Blue];
		}
		barSet.gauge_trans.GetComponent<UISprite>().color = color;
		Vector3 vector = new Vector3(num, 1f, 1f);
		if (is_anime)
		{
			Hashtable args = TweenHash.EaseOutSine(TweenHash.Type.Scale, vector, 0.4f);
			iTween.ScaleTo(barSet.gauge_trans.gameObject, args);
		}
		else
		{
			barSet.gauge_trans.localScale = vector;
		}
	}

	public void SetCurrentMind(int cur_num, bool is_anime)
	{
		YotogiParamBasicBar.BarSet barSet = this.bar_dic_[YotogiParamBasicBar.Kind.Mind];
		barSet.num_label.text = cur_num.ToString();
		float num = (float)cur_num / (float)barSet.max;
		Color color;
		if ((double)num <= 0.3)
		{
			color = this.color_dic_[YotogiParamBasicBar.GageColor.Red];
		}
		else
		{
			color = this.color_dic_[YotogiParamBasicBar.GageColor.Blue];
		}
		barSet.gauge_trans.GetComponent<UISprite>().color = color;
		Vector3 vector = new Vector3(num, 1f, 1f);
		if (is_anime)
		{
			Hashtable args = TweenHash.EaseOutSine(TweenHash.Type.Scale, vector, 0.4f);
			iTween.ScaleTo(barSet.gauge_trans.gameObject, args);
		}
		else
		{
			barSet.gauge_trans.localScale = vector;
		}
	}

	public void SetCurrentSensual(int cur_num, bool is_anime)
	{
		YotogiParamBasicBar.BarSet barSet = this.bar_dic_[YotogiParamBasicBar.Kind.Sensual];
		barSet.num_label.text = cur_num.ToString();
		float x = (float)cur_num / (float)barSet.max;
		Color color = this.color_dic_[YotogiParamBasicBar.GageColor.Pink];
		barSet.gauge_trans.GetComponent<UISprite>().color = color;
		Vector3 vector = new Vector3(x, 1f, 1f);
		if (is_anime)
		{
			Hashtable args = TweenHash.EaseOutSine(TweenHash.Type.Scale, vector, 0.4f);
			iTween.ScaleTo(barSet.gauge_trans.gameObject, args);
		}
		else
		{
			barSet.gauge_trans.localScale = vector;
		}
	}

	private Dictionary<YotogiParamBasicBar.Kind, YotogiParamBasicBar.BarSet> bar_dic_ = new Dictionary<YotogiParamBasicBar.Kind, YotogiParamBasicBar.BarSet>();

	private Dictionary<YotogiParamBasicBar.GageColor, Color> color_dic_ = new Dictionary<YotogiParamBasicBar.GageColor, Color>();

	protected Maid maid_;

	private enum Kind
	{
		Excite,
		Mind,
		Sensual
	}

	private enum GageColor
	{
		Blue,
		Red,
		Yellow,
		Orange,
		Pink
	}

	private class BarSet
	{
		public Transform gauge_trans;

		public UILabel num_label;

		public int min;

		public int max;
	}
}
