Exemple #1
0
        public static bool CreateFoodAndPushConsumeOnSim(ConcessionsStand.BaseFoodData baseFoodData, Sim sim)
        {
            CommonMethods.ShowMessage(baseFoodData.mFoodType.ToString() + " " + baseFoodData);
            bool result = true;

            switch (baseFoodData.mFoodType)
            {
            case ConcessionsStand.FoodType.HotBeverage:
            case ConcessionsStand.FoodType.ColdBeverage:
            {
                BaseFoodStand.BaseFoodStandBeverage baseFoodStandBeverage = CreateBeverage(baseFoodData.FoodType == BaseFoodStand.FoodType.HotBeverage, sim);
                if (baseFoodStandBeverage != null)
                {
                    BaseFoodStand.FoodType foodType = baseFoodData.FoodType;
                    baseFoodStandBeverage.IsColdResortDrink = (foodType == BaseFoodStand.FoodType.ColdBeverage);
                    float tempChangePerSip = (foodType == BaseFoodStand.FoodType.HotBeverage) ? ConcessionsStand.kTempChangePerSipHotDrink : ConcessionsStand.kTempChangePerSipColdDrink;
                    baseFoodStandBeverage.InitData(baseFoodData.DrinkNameLocKey, baseFoodData.BevFoodUnits, baseFoodData.BuffToAdd, tempChangePerSip);
                    baseFoodData = null;
                    baseFoodStandBeverage.SetOpacity(0f, 0f);
                    if (sim.ParentToRightHand(baseFoodStandBeverage))
                    {
                        CarrySystem.EnterWhileHolding(sim, baseFoodStandBeverage);
                        baseFoodStandBeverage.FadeIn(true);
                        sim.Wander(ConcessionsStand.kMinMaxWanderBeforeDrink[0], ConcessionsStand.kMinMaxWanderBeforeDrink[1], false, RouteDistancePreference.NoPreference, false);
                        result = baseFoodStandBeverage.PushDrinkAsContinuation(sim);
                    }
                    else
                    {
                        baseFoodStandBeverage.Destroy();
                        result = false;
                    }
                }
                break;

                //string instanceName = (selectedFood.mFoodType == ConcessionsStand.FoodType.HotBeverage) ? "beverageCupHot" : "beverageCupCold";
                //ConcessionsStand.ConcessionsBeverage concessionsBeverage = GlobalFunctions.CreateObject(instanceName, ProductVersion.EP8, sim.Position, 1, Vector3.UnitZ, null, null) as ConcessionsStand.ConcessionsBeverage;
                //if (concessionsBeverage != null)
                //{
                //    float tempChangePerSip = (selectedFood.mFoodType == BaseFoodStand.FoodType.HotBeverage) ? ConcessionsStand.kTempChangePerSipHotDrink : ConcessionsStand.kTempChangePerSipColdDrink;
                //    concessionsBeverage.InitData(selectedFood.DrinkNameLocKey, selectedFood.BevFoodUnits, selectedFood.BuffToAdd, tempChangePerSip);
                //  //  concessionsBeverage.InitData(selectedFood.mFoodType, selectedFood.mDrinkNameLocKey, selectedFood.mBevFoodUnits, selectedFood.mBuffToAdd);
                //    concessionsBeverage.SetOpacity(0f, 0f);
                //    if (sim.ParentToRightHand(concessionsBeverage))
                //    {
                //        CarrySystem.EnterWhileHolding(sim, concessionsBeverage);
                //        concessionsBeverage.FadeIn(true);
                //        sim.Wander(ConcessionsStand.kMinMaxWanderBeforeDrink[0], ConcessionsStand.kMinMaxWanderBeforeDrink[1], false, RouteDistancePreference.NoPreference, false);
                //        result = concessionsBeverage.PushDrinkAsContinuation(sim);
                //    }
                //    else
                //    {
                //        concessionsBeverage.Destroy();
                //        result = false;
                //    }
                //}
                //break;
            }
            }
            return(result);
        }
Exemple #2
0
        public bool BuyAndEatConcessionsFood(Sim sim, bool autonomous)
        {
            bool result = false;

            ConcessionsStand.BaseFoodData foodData = ShowBuyConcessionsFoodDialog(autonomous);

            if (foodData != null)
            {
                CommonMethods.ShowMessage("Food data is not null");
                result = CreateFoodAndPushConsumeOnSim(foodData, sim);
            }
            return(result);
        }