Beispiel #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);
        }
Beispiel #2
0
        public List <ushort> GetAvailibleFoodGuids(BaseFoodStand.FoodType foodType, Sim sim)
        {
            List <ushort> list   = new List <ushort>();
            Season        season = SeasonsManager.Enabled ? SeasonsManager.CurrentSeason : Season.Summer;

            using (Dictionary <ushort, BaseFoodStand.BaseFoodData> .ValueCollection.Enumerator enumerator = ConcessionsStand.SeasonalFoodData.sSeasonalFoodData.Values.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ConcessionsStand.SeasonalFoodData seasonalFoodData = (ConcessionsStand.SeasonalFoodData)enumerator.Current;
                    if ((foodType == BaseFoodStand.FoodType.None || seasonalFoodData.FoodType == foodType) && (byte)(seasonalFoodData.AvailableSeasons & season) > 0)
                    {
                        list.Add(seasonalFoodData.Guid);
                    }
                }
            }
            return(list);
        }