Exemplo n.º 1
0
 protected void AddNotifier(BaseNotifier notifier)
 {
     notifier.singleTransform.parent        = singleTransform;
     notifier.singleTransform.localPosition = GetOutNotifierPlace(0);
     notifiersQueue.Add(notifier);
     notifier.SetNotifierController(this);
 }
Exemplo n.º 2
0
 public virtual void ChangePlaces(int startPlace = 0)
 {
     for (int i = startPlace; i < notifiersInProgress.Count; i++)
     {
         BaseNotifier inProgressNotifier = (BaseNotifier)notifiersInProgress[i];
         inProgressNotifier.FlyPlace(GetInNotifierPlace(i));
     }
 }
Exemplo n.º 3
0
    public virtual void NotifierWantsToFlyOut(BaseNotifier notifier)
    {
        int position = notifiersInProgress.IndexOf(notifier);

        notifiersInProgress.Remove(notifier);
        notifier.FlyOut(GetOutNotifierPlace(position));
        ChangePlaces();
    }
Exemplo n.º 4
0
    public override void NotifierWantsToFlyOut(BaseNotifier notifier)
    {
        int position = notifiersInProgress.IndexOf(notifier) - 1;

        notifiersInProgress.Remove(notifier);
        notifier.singleTransform.localPosition = new Vector3(notifier.singleTransform.localPosition.x, notifier.singleTransform.localPosition.y, -position * Z_INDEX_PER_POSITION);
        notifier.FlyOut(GetOutNotifierPlace(position));
        ChangePlaces();
        //base.NotifierWantsToFlyOut (notifier);
        //
    }
Exemplo n.º 5
0
        public void NotifyRemoval(BaseNotifier notifier)
        {
            Event eventToBeNotifiedAbout = ((EventNotifier)notifier).EvetToBeNotifiedAbout;

            if (!eventToBeNotifiedAbout.Participants.Contains(this, new PersonComparer()))
            {
                return;
            }

            if (!ScheduledEvents.Contains(eventToBeNotifiedAbout, new EventComparer()))
            {
                return;
            }

            CancleParticipationInEvent(eventToBeNotifiedAbout);
            DbManager.Instance.ModifyPerson(this);
        }
Exemplo n.º 6
0
        public void NotifyAdditon(BaseNotifier notifier)
        {
            Event eventToBeNotifiedAbout = ((EventNotifier)notifier).EvetToBeNotifiedAbout;

            if (!eventToBeNotifiedAbout.Participants.Contains(this, new PersonComparer()))
            {
                return;
            }

            if (IsAvailableForEvent(eventToBeNotifiedAbout.ScheduledDateTimeBeging, eventToBeNotifiedAbout.ScheduledDateTimeEnd))
            {
                if (ScheduleParticipationInEvent(eventToBeNotifiedAbout))
                {
                    DbManager.Instance.ModifyPerson(this);
                }
            }
        }
Exemplo n.º 7
0
        public void NotifyChange(BaseNotifier notifier)
        {
            Event eventToBeNotifiedAbout = ((EventNotifier)notifier).EvetToBeNotifiedAbout;

            if (eventToBeNotifiedAbout.Participants.Contains(this, new PersonComparer()))
            {
                if (ScheduledEvents.Contains(eventToBeNotifiedAbout, new EventComparer()))
                {
                    if (IsAvailableForEventExcludingOneSpecificEvent(eventToBeNotifiedAbout.ScheduledDateTimeBeging, eventToBeNotifiedAbout.ScheduledDateTimeEnd, eventToBeNotifiedAbout))
                    {
                        if (CancleParticipationInEvent(eventToBeNotifiedAbout) && ScheduleParticipationInEvent(eventToBeNotifiedAbout))
                        {
                            DbManager.Instance.ModifyPerson(this);
                        }
                    }
                    else
                    {
                        if (CancleParticipationInEvent(eventToBeNotifiedAbout))
                        {
                            DbManager.Instance.ModifyPerson(this);
                        }
                    }
                }
                else
                {
                    if (IsAvailableForEvent(eventToBeNotifiedAbout.ScheduledDateTimeBeging, eventToBeNotifiedAbout.ScheduledDateTimeEnd))
                    {
                        if (ScheduleParticipationInEvent(eventToBeNotifiedAbout))
                        {
                            DbManager.Instance.ModifyPerson(this);
                        }
                    }
                }
            }
            else
            {
                if (ScheduledEvents.Contains(eventToBeNotifiedAbout, new EventComparer()))
                {
                    if (CancleParticipationInEvent(eventToBeNotifiedAbout))
                    {
                        DbManager.Instance.ModifyPerson(this);
                    }
                }
            }
        }
Exemplo n.º 8
0
 protected virtual void Update()
 {
     if (notifiersInProgress.Count < GetMaxNotifiersToShow())
     {
         if (notifiersQueue.Count > 0)
         {
             BaseNotifier notifier = (BaseNotifier)notifiersQueue[0];
             int          i        = 0;
             for (; i < notifiersInProgress.Count; i++)
             {
                 if (((BaseNotifier)notifiersInProgress[i]).priority > notifier.priority)
                 {
                     break;
                 }
             }
             int position = i;
             notifier.singleTransform.localPosition = GetOutNotifierPlace(position);
             notifiersInProgress.Insert(position, notifier);
             notifiersQueue.Remove(notifier);
             notifier.FlyIn(GetInNotifierPlace(position));
             ChangePlaces(position + 1);
         }
     }
 }
Exemplo n.º 9
0
 public override void NotifierFlyOutEnd(BaseNotifier notifier)
 {
     notifiersInProgress.Remove(notifier);
     base.NotifierFlyOutEnd(notifier);
     ChangePlaces();
 }
Exemplo n.º 10
0
    public override void NotifierWantsToFlyOut(BaseNotifier notifier)
    {
        int position = notifiersInProgress.IndexOf(notifier);

        notifier.FlyOut(GetOutNotifierPlace(position));
    }
Exemplo n.º 11
0
 public virtual void NotifierFlyOutEnd(BaseNotifier notifier)
 {
     Destroy(notifier.gameObject);
 }