Esempio n. 1
0
        public virtual void FinishLoad(int zoneObjectSyncValue = -1)
        {
            if (zoneObjectSyncValue != -1)
            {
                ZoneObjectSyncLoad(zoneObjectSyncValue);
            }

            if (_flavorOptions != null && _flavorOptions.Count != 0)
            {
                foreach (string key in FlavorOptions.Keys)
                {
                    int    selectedPosition     = GlobalReference.GlobalValues.Random.Next(FlavorOptions[key].Count);
                    string selectedFlavorOption = FlavorOptions[key][selectedPosition];

                    ShortDescription   = ShortDescription.Replace(key, selectedFlavorOption);
                    LongDescription    = LongDescription.Replace(key, selectedFlavorOption);
                    ExamineDescription = ExamineDescription.Replace(key, selectedFlavorOption);

                    SentenceDescription = SentenceDescription.Replace(key, selectedFlavorOption);
                    for (int i = 0; i < KeyWords.Count; i++)
                    {
                        KeyWords[i] = KeyWords[i].Replace(key, selectedFlavorOption);
                    }
                }
            }


            ILoadableItems loadableItem = this as ILoadableItems;

            if (loadableItem != null)
            {
                if (loadableItem.LoadableItems.Count > 0)
                {
                    foreach (ILoadPercentage percentage in loadableItem.LoadableItems)
                    {
                        if (percentage.Load)
                        {
                            AddItem(this, percentage.Object);
                            percentage.Object.FinishLoad();
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public virtual void ZoneObjectSyncLoad(int syncValue)
        {
            if (ZoneSyncOptions.Count != 0)
            {
                foreach (string key in ZoneSyncOptions.Keys)
                {
                    string selectedFlavorOption = ZoneSyncOptions[key][syncValue];

                    ShortDescription   = ShortDescription.Replace(key, selectedFlavorOption);
                    LongDescription    = LongDescription.Replace(key, selectedFlavorOption);
                    ExamineDescription = ExamineDescription.Replace(key, selectedFlavorOption);
                    if (SentenceDescription != null) //rooms do not have sentence descriptions
                    {
                        SentenceDescription = SentenceDescription.Replace(key, selectedFlavorOption);
                    }

                    if (key == "ZoneSyncKeywords")
                    {
                        KeyWords.AddRange(selectedFlavorOption.Split(','));
                    }
                }
            }
        }