コード例 #1
0
ファイル: WorldData.cs プロジェクト: yakoder/NRaas
        public void OnWorldLoadFinished()
        {
            if (sInitial)
            {
                MergeToCrossWorldData();
                sInitial = false;
            }

            SetVacationWorld(false, true);

            mOldHouse = Household.ActiveHousehold;

            new Common.DelayedEventListener(EventTypeId.kEventSimSelected, OnSelected);

            InWorldStateEx.LinkToTravelHousehold();

            if (!sDefaultBarTuned)
            {
                Bartending.BarData defaultData;
                if (Bartending.TryGetBarData(Lot.MetaAutonomyType.None, out defaultData))
                {
                    List <Bartending.BarData> choices = new List <Bartending.BarData>();

                    foreach (Bartending.BarData data in Bartending.sData.Values)
                    {
                        if (!data.IsPizzaAvailable)
                        {
                            continue;
                        }

                        if (data.mFoods.Count == 0)
                        {
                            continue;
                        }

                        choices.Add(data);
                    }

                    if (choices.Count > 0)
                    {
                        Bartending.BarData choice = RandomUtil.GetRandomObjectFromList(choices);

                        defaultData.mFoodQualityMinimum = choice.mFoodQualityMinimum;
                        defaultData.mFoodQualityMaximum = choice.mFoodQualityMaximum;
                        defaultData.mIsPizzaAvailable   = true;
                        defaultData.mPriceMultiplier    = choice.mPriceMultiplier;
                        defaultData.mPriceCapMultiplier = choice.mPriceCapMultiplier;
                        defaultData.mFoods = choice.mFoods;
                    }
                }
            }
        }
コード例 #2
0
 // this is injected even for lots that aren't a bar to take advantage of the core and make the game honor
 // open/close times for roles and such
 public static void InjectBarData(string varname, TagStaticData tData)
 {
     Lot.MetaAutonomyType type;
     if (ParserFunctions.TryParseEnum <Lot.MetaAutonomyType>(varname, out type, Lot.MetaAutonomyType.None))
     {
         XmlDbTable table;
         XmlDbData  data = XmlDbData.ReadData("Bars");
         if (data.Tables.TryGetValue("Venues", out table))
         {
             XmlDbRow           row     = table.Rows[1];
             Bartending.BarData rowData = new Bartending.BarData(row);
             rowData.mHourOpen  = tData.openHour;
             rowData.mHourClose = tData.closeHour;
             if (!Bartending.sData.ContainsKey(type))
             {
                 Bartending.sData[type] = rowData;
             }
         }
     }
 }
コード例 #3
0
ファイル: InjectionHelper.cs プロジェクト: KhArtNJava/NRaas
 // this is injected even for lots that aren't a bar to take advantage of the core and make the game honor
 // open/close times for roles and such
 public static void InjectBarData(string varname, TagStaticData tData)
 {
     Lot.MetaAutonomyType type;
     if (ParserFunctions.TryParseEnum<Lot.MetaAutonomyType>(varname, out type, Lot.MetaAutonomyType.None))
     {
         XmlDbTable table;
         XmlDbData data = XmlDbData.ReadData("Bars");
         if (data.Tables.TryGetValue("Venues", out table))
         {
             XmlDbRow row = table.Rows[1];
             Bartending.BarData rowData = new Bartending.BarData(row);
             rowData.mHourOpen = tData.openHour;
             rowData.mHourClose = tData.closeHour;
             if (!Bartending.sData.ContainsKey(type))
             {
                 Bartending.sData[type] = rowData;
             }
         }                
     }
 }