private static Taste GetTaste(DefuzzyPropertiesTO defuzzyPropertiesTo) { if (Mathf.Max(defuzzyPropertiesTo.Strong, defuzzyPropertiesTo.Soft, defuzzyPropertiesTo.Weak) == 0f) { return(Taste.Undefined); } if (Mathf.Max(defuzzyPropertiesTo.Strong, defuzzyPropertiesTo.Soft, defuzzyPropertiesTo.Weak) == defuzzyPropertiesTo.Strong) { return(Taste.Strong); } if (Mathf.Max(defuzzyPropertiesTo.Strong, defuzzyPropertiesTo.Soft, defuzzyPropertiesTo.Weak) == defuzzyPropertiesTo.Soft) { return(Taste.Soft); } if (Mathf.Max(defuzzyPropertiesTo.Strong, defuzzyPropertiesTo.Soft, defuzzyPropertiesTo.Weak) == defuzzyPropertiesTo.Weak) { return(Taste.Weak); } throw new Exception("FATAL ERROR ON FLOAT COMPARE"); }
public static DefuzzyPropertiesTO Fill(DrinkTO drinkTo, FuzzyPropertiesTO fuzzyPropertiesTo, DefuzzyPropertiesTO defuzzyPropertiesTo) { defuzzyPropertiesTo.Soft = Soft(drinkTo, fuzzyPropertiesTo); defuzzyPropertiesTo.Strong = Strong(drinkTo, fuzzyPropertiesTo); defuzzyPropertiesTo.Weak = Weak(drinkTo, fuzzyPropertiesTo); defuzzyPropertiesTo.Taste = GetTaste(defuzzyPropertiesTo); defuzzyPropertiesTo.IsCubaLivre = IsCubaLivre(drinkTo); return(defuzzyPropertiesTo); }
public void Start() { _mixMenu = SceneManager.GetActiveScene() .GetRootGameObjects()[0].transform.Find("Canvas") .Find("MixMenu").gameObject; _sodaMenu = SceneManager.GetActiveScene() .GetRootGameObjects()[0].transform.Find("Canvas") .Find("SodaMenu").gameObject; _advancedResultsMenu = SceneManager.GetActiveScene() .GetRootGameObjects()[0].transform.Find("Canvas") .Find("AdvancedResultsMenu").gameObject; _cokeMixer = new Mixer(_mixMenu.transform.Find("CokeMixer").gameObject, this); _pepsiMixer = new Mixer(_mixMenu.transform.Find("PepsiMixer").gameObject, this); _iceCubesMixer = new Mixer(_mixMenu.transform.Find("IceCubesMixer").gameObject, this); _rumMixer = new Mixer(_mixMenu.transform.Find("RumMixer").gameObject, this); _tasteLbl = _mixMenu.transform.Find("TasteLbl").gameObject.GetComponent <Text>(); _priceLbl = _mixMenu.transform.Find("PriceLbl").gameObject.GetComponent <Text>(); _advancedResultsBtn = _mixMenu.transform.Find("AdvancedResultsBtn").gameObject.GetComponent <Button>(); _strongCokeLbl = _advancedResultsMenu.transform.Find("StrongCokeLbl").gameObject.GetComponent <Text>(); _softCokeLbl = _advancedResultsMenu.transform.Find("SoftCokeLbl").gameObject.GetComponent <Text>(); _weakCokeLbl = _advancedResultsMenu.transform.Find("WeakCokeLbl").gameObject.GetComponent <Text>(); _strongPepsiLbl = _advancedResultsMenu.transform.Find("StrongPepsiLbl").gameObject.GetComponent <Text>(); _softPepsiLbl = _advancedResultsMenu.transform.Find("SoftPepsiLbl").gameObject.GetComponent <Text>(); _weakPepsiLbl = _advancedResultsMenu.transform.Find("WeakPepsiLbl").gameObject.GetComponent <Text>(); _strongRumLbl = _advancedResultsMenu.transform.Find("StrongRumLbl").gameObject.GetComponent <Text>(); _softRumLbl = _advancedResultsMenu.transform.Find("SoftRumLbl").gameObject.GetComponent <Text>(); _weakRumLbl = _advancedResultsMenu.transform.Find("WeakRumLbl").gameObject.GetComponent <Text>(); _iceCubesLbl = _advancedResultsMenu.transform.Find("IceCubesLbl").gameObject.GetComponent <Text>(); _strongLbl = _advancedResultsMenu.transform.Find("StrongLbl").gameObject.GetComponent <Text>(); _softLbl = _advancedResultsMenu.transform.Find("SoftLbl").gameObject.GetComponent <Text>(); _weakLbl = _advancedResultsMenu.transform.Find("WeakLbl").gameObject.GetComponent <Text>(); _tasteLbl2 = _advancedResultsMenu.transform.Find("TasteLbl2").gameObject.GetComponent <Text>(); _priceLbl2 = _advancedResultsMenu.transform.Find("PriceLbl2").gameObject.GetComponent <Text>(); _isCubaLivreLbl = _mixMenu.transform.Find("IsCubaLivreLbl").gameObject.GetComponent <Text>(); _isCubaLivreLbl2 = _advancedResultsMenu.transform.Find("IsCubaLivreLbl2").gameObject.GetComponent <Text>(); _drinkTo = new DrinkTO(); _fuzzyPropertiesTo = new FuzzyPropertiesTO(); _defuzzyPropertiesTo = new DefuzzyPropertiesTO(); }