Esempio n. 1
0
        public WallContainer(Inventory parentInventory) : base(parentInventory: parentInventory)
        {
            Noun = new GNoun("mur", Genre.masuclin);


            sayOnTryToGo = "Oui de fait, je pense que vous allez dans le mur...";

            HasAboveContainer = true;
            aboveInventory    = new OnInventory(this);
        }
 public bool IsExisting(GNoun nounToFind)
 {
     foreach (var noun in nouns)
     {
         if (noun.Singular == nounToFind.Singular)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 3
0
        public Oobject(Inventory parentInventory)
        {
            ParentInventory    = parentInventory;
            HasAboveContainer  = false;
            HasInsideContainer = false;
            HasUnderContainer  = false;
            Id   = IdCounter++;
            Noun = new GNoun("", Genre.masuclin);

            //Synonyms = new string[] { Name };
        }
Esempio n. 4
0
        public CeilingContainer(Inventory parentInventory) : base(parentInventory: parentInventory)
        {
            Noun = new GNoun("plafond", Genre.masuclin);

            GenreSynonyms = new Genre[] { Genre.masuclin };

            sayOnTryToGo = "Mais bien sûr...";

            HasUnderContainer = true;
            underInventory    = new UnderInventory(this);
        }
Esempio n. 5
0
        public FloorContainer(Inventory parentInventory) : base(parentInventory: parentInventory)
        {
            //Synonyms = new string[]     {"sol"              };
            Noun = new GNoun("sol", Genre.masuclin);


            sayOnTryToGo = "Vous compter creuser??";

            HasAboveContainer = true;
            aboveInventory    = new OnInventory(this);
        }
Esempio n. 6
0
        public VoidContainer(Inventory parentInventory, Location location)  : base(parentInventory: parentInventory)
        {
            Location = location;
            //Synonyms = new string[] { "void" };

            Noun = new GNoun("Void", Genre.masuclin);

            HasAboveContainer  = false;
            HasInsideContainer = true;
            HasUnderContainer  = false;
            insideInventory    = new InsideInventory(this);
        }
Esempio n. 7
0
 public PlayerContainer(Inventory parentInventory, Player _player) : base(parentInventory: parentInventory)
 {
     Player = Player;
     //Synonyms = new string[] { "joueur" };
     GenreSynonyms      = new Genre[] { Genre.masuclin };
     Noun               = new GNoun("Moi", Genre.masuclin);
     Adjective          = null;
     HasAboveContainer  = false;
     HasInsideContainer = true;
     HasUnderContainer  = false;
     insideInventory    = new InsideInventory(this);
 }
        public void EditNoun(GNoun newNoun)
        {
            int   nounIdToEdit = newNoun.ID;
            GNoun nounToRemove = null;

            foreach (var noun in nouns)
            {
                if (nounIdToEdit == noun.ID)
                {
                    nounToRemove = noun;
                }
            }
            if (nounToRemove == null)
            {
                throw new NotImplementedException();
            }
            else
            {
                nouns.Remove(nounToRemove);
                nouns.Add(newNoun);
                newNoun.ID = nounIdToEdit;
            }
        }
Esempio n. 9
0
        public WordDictionary LoadDictionary(string CompletePath)
        {
            WordDictionary wordDictionary = new WordDictionary();

            XDocument doc;

            doc = XDocument.Load(CompletePath);
            foreach (XElement element in doc.Root.Element("World").Element("Nouns").Descendants("Noun"))
            {
                string genre     = element.Attribute("Genre").Value;
                Genre  genreBool = genre == "masculine" ? Genre.masuclin : Genre.feminin;
                GNoun  noun      = new GNoun(element.Attribute("Singular").Value,
                                             genreBool,
                                             Int32.Parse(element.Attribute("Id").Value),
                                             true);//to change, isSingular is always true!!!

                noun.Elision = bool.Parse(element.Attribute("Elision").Value);
                noun.Plural  = element.Attribute("Plural").Value;

                wordDictionary.Add(noun);
            }

            return(wordDictionary);
        }
 public void Add(GNoun noun)
 {
     nounsIdCounter++;
     noun.ID = nounsIdCounter;
     nouns.Add(noun);
 }