Esempio n. 1
0
        public void CompareObservations(Observation currentObservation, Observation expectedObservation)
        {
            List <Character> currentCharacters = new List <Character>(currentObservation.characters);

            //Expected Characters
            for (int i = 0, count = expectedObservation.characters.Count; i < count; i++)
            {
                Character character = expectedObservation.characters[i];

                if (currentCharacters.Remove(character) == false)
                {
                    Paradox paradox = new Paradox(currentObservation.time, visualsMeet, character);
                    currentParadoxes.Add(paradox);
                }
            }

            //Unexpected Characters
            for (int i = 0, count = currentCharacters.Count; i < count; i++)
            {
                Paradox paradox = new Paradox(currentObservation.time, visualsMeet, currentCharacters[i]);
                currentParadoxes.Add(paradox);
            }

            //Expected Items
            List <ItemProfile> currentItemProfiles = new List <ItemProfile>(currentObservation.itemProfiles);

            for (int i = 0, count = expectedObservation.itemProfiles.Count; i < count; i++)
            {
                ItemProfile expectedProfile = expectedObservation.itemProfiles[i];

                if (currentItemProfiles.Remove(expectedProfile) == false)
                {
                    //Expected item not found, locate paradoxes
                    for (int s = 0, currentCount = currentItemProfiles.Count; s < currentCount; s++)
                    {
                        ItemProfile currentProfile = currentItemProfiles[s];

                        if (currentProfile.CompareSurface(expectedProfile))
                        {
                            for (int t = 0; t < expectedProfile.itemsInsideProfiles.Length; t++)
                            {
                                ItemProfile expectedInsideProfile = expectedProfile.itemsInsideProfiles[t];

                                if (currentProfile.itemsInsideProfiles.Length <= t || expectedInsideProfile != currentProfile.itemsInsideProfiles[t])
                                {
                                    Paradox paradox = new Paradox(currentObservation.time, visualsMeet, expectedInsideProfile);
                                    currentParadoxes.Add(paradox);
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public Item FindContainer()
        {
            for (int i = 0, count = location.items.Count; i < count; i++)
            {
                Item        container        = location.items[i];
                ItemProfile containerProfile = container.GetProfile();

                if (itemContainerProfile.CompareSurface(containerProfile))
                {
                    return(container);
                }
            }

            return(null);
        }