private int GetShakeAmount(Recipy.DrinkName drinkName) { foreach (Recipy recipy in drinkRecipys) { if (recipy.drinkName == drinkName) { return(recipy.shake); } } return(0); }
public void Serve() { if (drinkName != Recipy.DrinkName.NULL) { return; } drinkName = GetDrink(); int desiredShake = GetShakeAmount(drinkName); if (shake == desiredShake) { drinkQuality = Recipy.DrinkQuality.Perfect; } else if (shake <= desiredShake + 10 && shake >= desiredShake - 10) { drinkQuality = Recipy.DrinkQuality.Good; } else if (shake <= desiredShake + 20 && shake >= desiredShake - 20) { drinkQuality = Recipy.DrinkQuality.Bad; } else { drinkQuality = Recipy.DrinkQuality.Sludge; } //send the drink out resultsImage.sprite = GetSprite(drinkName); Debug.Log("DrinkName : " + drinkName.ToString()); Debug.Log("SpriteName : " + GetSprite(drinkName).name); resutsAnimator.Play("Start"); //send this to ryan charManagerComponent.ServeOrder(drinkName, drinkQuality); Debug.Log("Finished Drink : " + drinkQuality.ToString() + " " + drinkName.ToString()); //reset teh current mix currentMix = new Dictionary <Recipy.Ingredient, int>(); drinkName = Recipy.DrinkName.NULL; shake = 0; }
private Sprite GetSprite(Recipy.DrinkName drinkName) { switch (drinkName) { case Recipy.DrinkName.Moonshine: return(moonshine); case Recipy.DrinkName.Bloodmoon: return(bloodmoon); case Recipy.DrinkName.Fruitmoon: return(fruitmoon); case Recipy.DrinkName.Midnightmoon: return(midnightmoon); case Recipy.DrinkName.SexOnTheMoon: return(sexonthemoon); case Recipy.DrinkName.ShootingStar: return(shootingstar); case Recipy.DrinkName.VoidsRevenge: return(voidsrevenge); case Recipy.DrinkName.VoidOrangeJuice: return(voidorangejuice); case Recipy.DrinkName.MoonberryJuice: return(moonberryjuice); case Recipy.DrinkName.ShotOfCosmicLiquer: return(shotofcosmicliqure); case Recipy.DrinkName.GlassFromTheUnderWorld: return(glassferomtheunderworld); case Recipy.DrinkName.WaterCyclone: return(watercyclone); } return(moonshine); }