示例#1
0
    public void AddTherapie()
    {
        switch (therapieTyp)
        {
        case TherapieTyp.MEDIKAMENT:
            Medikament medi = new Medikament(therapieName, description, weekdays, times, imageIndex, colorsImage[colorIndex], counts);
            manager.TherapiePlan.AddMedikament(medi);
            therapiePanel.AddElement(medi);
            break;

        case TherapieTyp.INHALATION:
            Inhalation inha = new Inhalation(therapieName, description, weekdays, times, durations);
            manager.TherapiePlan.AddInhalation(inha);
            therapiePanel.AddElement(inha);
            break;

        case TherapieTyp.PHYSIOTHERAPIE:
            Physiotherapie physio = new Physiotherapie(weekdays, times, sportTyp);
            manager.TherapiePlan.AddPhysiotherapie(physio);
            therapiePanel.AddElement(physio);
            break;

        default:
            break;
        }
        therapieNeuCanvas.SetActive(false);
        therapiePlanCanvas.SetActive(true);
        Reset();
        manager.needsToSave = true;
    }
示例#2
0
    //Init the Physiotimes list and fill it with the physiotherapy times from activetherapies
    void InitPhysioTimes()
    {
        TherapiePlanManager manager = TherapiePlanManager.instance;

        physioTimes = new List <float>();
        foreach (float time in manager.AktiveTherapieZeiten)
        {
            int dayOfWeek = (int)System.DateTime.Now.DayOfWeek - 1;
            dayOfWeek = dayOfWeek < 0 ? 6 : dayOfWeek;

            //If the time is from yesterday
            if (time > System.DateTime.Now.Hour)
            {
                dayOfWeek -= 1;
                dayOfWeek  = dayOfWeek < 0 ? 6 : dayOfWeek;
            }

            foreach (TherapiePlan.TherapieInfo therapieInfo in manager.TherapiePlan.GetTherapieInfoFor(dayOfWeek, time))
            {
                Therapie       t = manager.TherapiePlan.Therapien[therapieInfo.index];
                Physiotherapie p = t as Physiotherapie;
                if (p != null)
                {
                    physioTimes.Add(time);
                }
            }
        }
    }
示例#3
0
 public void AddPhysiotherapie(Physiotherapie _physiotherapie)
 {
     physiotherapieListe.Add(_physiotherapie);
     AddTherapie(_physiotherapie);
 }
示例#4
0
 public void RemovePhysiotherapie(Physiotherapie _physiotherapie)
 {
     physiotherapieListe.Remove(_physiotherapie);
     RemoveTherapie(_physiotherapie);
 }