Beispiel #1
0
        /// <summary>
        /// Put it in the cache
        /// </summary>
        /// <returns>success status</returns>
        public override bool PersistToCache()
        {
            try
            {
                LexicalContext collectiveContext = new LexicalContext(null)
                {
                    Determinant = true,
                    Perspective = NarrativePerspective.ThirdPerson,
                    Plural      = false,
                    Position    = LexicalPosition.None,
                    Tense       = LexicalTense.Present
                };

                List <IDictata> dictatas = new List <IDictata>
                {
                    new Dictata(new Lexica(LexicalType.ProperNoun, GrammaticalType.Subject, Name, collectiveContext))
                };
                dictatas.AddRange(Descriptives.Select(desc => desc.Event.GetDictata()));

                foreach (IDictata dictata in dictatas)
                {
                    LexicalProcessor.VerifyLexeme(dictata.GetLexeme());
                }

                TemplateCache.Add(this);
            }
            catch (Exception ex)
            {
                LoggingUtility.LogError(ex, LogChannels.SystemWarnings);
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Retrieve all of the descriptors that are tagged
        /// </summary>
        /// <returns>A collection of the descriptors</returns>
        public virtual IEnumerable <ISensoryEvent> GetTouchDescriptives(IEntity viewer)
        {
            if (Descriptives == null)
            {
                return(Enumerable.Empty <ISensoryEvent>());
            }

            return(Descriptives.Where(desc => desc.SensoryType == MessagingType.Tactile));
        }