Exemple #1
0
 protected override void setReferences()
 {
     base.setReferences();
     // Also checks the current GameObject (as per the current prefab setup)
     buttonController = GetComponentInChildren <DogBrowserButtonController>();
     dogSlots         = GetComponentsInChildren <DogSlot>();
     database         = DogDatabase.GetInstance;
 }
Exemple #2
0
    protected override void fetchReferences()
    {
        base.fetchReferences();
        database = DogDatabase.GetInstance;
        EventController.Event(PPEvent.LoadShelter);

        var dogs = populateAvailableDogs(database);

        dogShelterProfile.buttonController.Init(dogShelterProfile, dogs);
    }
Exemple #3
0
    public override bool RunTest(out string feedback)
    {
        DogDatabase data = DogDatabase.GetInstance;

        for (int i = 0; i < dogWorldSlots.Length; i++)
        {
            dataController.Adopt(data.Dogs[i]);
        }
        feedback = "Good job, Joel";
        return(true);
    }
Exemple #4
0
    DogSpriteDisplayTool[] displayAllDogs()
    {
        DogDatabase data    = DogDatabase.GetInstance;
        int         numDogs = data.Dogs.Length;

        DogDescriptor[]        dogs     = data.Dogs;
        DogSpriteDisplayTool[] displays = new DogSpriteDisplayTool[numDogs];
        viewParent.sizeDelta = Vector2.one + Vector2.right * numDogs * widthPerDisplay;
        for (int i = 0; i < numDogs; i++)
        {
            displays[i] = addDogToView(dogs[i]);
        }
        return(displays);
    }
 protected override void setReferences()
 {
     base.setReferences();
     if (isSingleton)
     {
         dogDatabase = parseDogDatabase();
         shop        = parseShopDatabase();
         gifts       = parseGiftDatabase();
         tuning      = parseTuning();
         languages   = initLanguages();
         shop.Initialize();
         gifts.Initialize();
     }
 }
        private Dog chooseDog(Dog dogQualities)
        {
            Dog appropriateDog = null;
            DogDatabase database = new DogDatabase();
            foreach (Dog currentDog in database.database)
            {
                if (checkChildren(dogQualities.GoodWithChildren, currentDog.GoodWithChildren))
                    if (checkDrools(dogQualities.Drools, currentDog.Drools))
                        if (dogQualities.Coatlength.Equals(currentDog.Coatlength))
                            if (checkScalers(dogQualities.ActivityLevel, currentDog.ActivityLevel))
                                if (checkScalers(dogQualities.SheddingLevel, currentDog.SheddingLevel))
                                    if (checkScalers(dogQualities.GroomingLevel, currentDog.GroomingLevel))
                                        if (checkScalers(dogQualities.IntelligenceLevel, currentDog.IntelligenceLevel))
                                            if (checkSize(dogQualities.Size, currentDog.Size))
                                                appropriateDog = currentDog;
            }

            return appropriateDog;
        }
Exemple #7
0
 DogDescriptor[] populateAvailableDogs(DogDatabase database)
 {
     DogDescriptor[] dogs;
     if (tuning.SampleShelterDogsInOrder)
     {
         dogs = database.GetInOrderDogList(
             availableDogPortraits.Length,
             skipAdopted: true,
             startIndex: 0,
             maxMasterIndex: (tuning.ShouldLimitShelterDogs ?
                              tuning.ShelterDogsLimit : int.MaxValue));
     }
     else
     {
         dogs = database.GetDailyRandomDogList(availableDogPortraits.Length);
     }
     dogs = fillInEmptySlots(dogs);
     for (int i = 0; i < dogs.Length; i++)
     {
         availableDogPortraits[i].Init(dogs[i]);
     }
     return(dogs);
 }
Exemple #8
0
 public DogBreed(DogDatabase data) : base(data)
 {
     // NOTHING
 }
Exemple #9
0
 public DogTrait(DogDatabase data) : base(data)
 {
 }
Exemple #10
0
 public PPDescriptor(DogDatabase data) : base(data)
 {
     // NOTHING
 }
Exemple #11
0
 public bool AllDogsAdopted(DogDatabase dogDatabase)
 {
     return(dogDatabase.Dogs.Length <= AdoptedDogs.Count);
 }
Exemple #12
0
 public virtual void Initialize(DogDatabase data)
 {
     this.database = data;
 }
Exemple #13
0
 public PPData(DogDatabase data)
 {
     Initialize(data);
 }
Exemple #14
0
 public PPData()
 {
     this.database = null;
 }