Beispiel #1
0
        public void Fertiliser(int buff)
        {
            if (buff > 1)
            {
                int x = Position.Key;
                int y = Position.Value;

                Cellule cell = Grille.GetInstance().GetCellule(x + 1, y);
                if (cell)
                {
                    cell.Fertiliser(buff - 1);
                }

                cell = Grille.GetInstance().GetCellule(x - 1, y);
                if (cell)
                {
                    cell.Fertiliser(buff - 1);
                }

                cell = Grille.GetInstance().GetCellule(x, y + 1);
                if (cell)
                {
                    cell.Fertiliser(buff - 1);
                }

                cell = Grille.GetInstance().GetCellule(x, y - 1);
                if (cell)
                {
                    cell.Fertiliser(buff - 1);
                }
            }
        }
Beispiel #2
0
        private void ChangeMonth(int month)
        {
            LegumeManager.State requestState = LegumeManager.GetInstance().GetLegumeInfo(Type).m_Calendar[month];

            switch (requestState)
            {
            case LegumeManager.State.Graine:
                if (_state == LegumeManager.State.Pourri)
                {
                    OnGrow(1);
                }
                break;

            case LegumeManager.State.Pousse:
                if (_state == LegumeManager.State.Graine)
                {
                    OnGrow(1);
                }
                break;

            case LegumeManager.State.Recolte:
                if (_state == LegumeManager.State.Pousse)
                {
                    OnGrow(1);
                }
                break;

            case LegumeManager.State.Pourri:
                if (_state == LegumeManager.State.Graine)
                {
                    M_Cellule.Supprimer();
                }
                else if (_state == LegumeManager.State.Pousse)
                {
                    OnGrow(2);
                }
                else if (_state == LegumeManager.State.Recolte)
                {
                    OnGrow(1);
                    M_Cellule.Fertiliser(1);
                }
                break;
            }
        }