public virtual int Practice(Group group, Equipment equipment, ISubActivities subActivities) { MessageEventArgs message = new MessageEventArgs(); successFactor = 0; message.text = "Practice start : "; Message?.Invoke(this, message); successFactor += CheckEquipment(equipment); if (subActivities != null) { SuccessFactorEventArgs factor = new SuccessFactorEventArgs(); successFactor += 1; factor.text = subActivities.Action() + ".Student success factor: "; factor.successFactor = successFactor; Factor?.Invoke(this, factor); } message.text = "Students study"; Message?.Invoke(this, message); groupRating.SetGroupGrades(group, name); return(successFactor); }
protected virtual int CheckEquipment(Equipment equipment) { SuccessFactorEventArgs factor = new SuccessFactorEventArgs(); if (equipment != null) { if (equipment.Name == "Computer") { successFactor += 3; factor.text = "Students use computer. Student success factor: "; factor.successFactor = successFactor; Factor?.Invoke(this, factor); } if (equipment.Name == "Tape recorder") { successFactor += -1; factor.text = "Teacher use tape recorder. Student success factor: "; factor.successFactor = successFactor; Factor?.Invoke(this, factor); } } return(successFactor); }
protected void CallFactorEvent(object source, SuccessFactorEventArgs arg) { Factor?.Invoke(source, arg); }