Example #1
0
        public void Init()
        {
            if (m_CurrentPetIndex == account.petsList.Count)
            {
                account.SetNextMeal();
                account.GetNextMeal();
                return;
            }

            if ((CheckTime(account.petsList[m_CurrentPetIndex])) ||
                ((m_Feeding != null) && (m_Feeding.SecondFeeding)))
            {
                if (
                    account.petsList[m_CurrentPetIndex].Informations.Position == 8)
                {
                    Console.WriteLine();
                }

                if (account.petsList[m_CurrentPetIndex].FoodList.Count == 0)
                {
                    if (account.Safe == null)
                    {
                        NoFood();
                        return;
                    }

                    if (!m_OnSafe)
                    {
                        m_OnSafe   = true;
                        m_Openning = new Opening();
                        m_Openning.Init(account);
                        return;
                    }

                    LeavingFoodToSafe();
                    return;
                }

                m_Feeding = new Feeding(account);
                m_Feeding.Init(account.petsList[m_CurrentPetIndex]);
                account.Wait(500, 1000);
                m_CurrentPetIndex++;
                return;
            }

            m_CurrentPetIndex++;
            Init();
        }