Beispiel #1
0
        public VerbHolder(StemGenerator generator)
        {
            verbs = new Dictionary <string, Verb>
            {
                {
                    "Change color", new Verb("Change color",
                                             (noun, adjective, verb) =>
                    {
                        if (adjective == null)
                        {
                            return(false);
                        }
                        if (noun == null)
                        {
                            return(false);
                        }
                        if (adjective.propertyType == "color" && noun.properties.ContainsKey("color"))
                        {
                            noun.properties["color"] = adjective.englishTerm;
                            return(true);
                        }
                        return(false);
                    }, (noun, adjective) => $"Poof! The {noun.myNoun.englishMeaning.ToLower( )} changes color to {adjective.englishTerm}!", () => "Suddenly vibrant colors splash around the room, but in the end nothing happens."
                                             )
                },
            };
            verbEnding = "ra";
            Debug.WriteLine("Verbs:");

            foreach (var verb in verbs)
            {
                verb.Value.verb = generator.GenerateRoot(verb.Value.englishTerm).stem + verbEnding;
                Debug.WriteLine($">>>{verb.Value.englishTerm} : {verb.Value.verb}");
            }
        }
 public Adjective(string propertyType, string englishTerm, StemGenerator generator)
 {
     this.propertyType = propertyType;
     this.englishTerm  = englishTerm;
     word = generator.GenerateRoot(englishTerm).stem;
 }