Пример #1
0
 void Start()
 {
     calendar  = GetComponentInParent <Calendar>();
     eventLine = GetComponentInChildren <EventLine>();
     eventLine.gameObject.SetActive(false);
     dayNumberTextField.text = representedDay.Day.ToString();
 }
Пример #2
0
        public void GetMatchedUsers(Event obj)
        {
            User one = Get(obj.userId);

            switch (obj.EventName)
            {
            case "Event1": {
                string event1 = "playing With mosh";

                string line1 = one.FirstName + " " + one.LastName + " " + "Is going to " + event1;

                EventLine ev = new EventLine()
                {
                    line = line1
                };
                Context.Events.Insert(ev);

                return;
            }

            case "Event2":
            {
                string event2 = "playing Socker With Tzach";

                string    line2 = one.FirstName + " " + one.LastName + " " + "Is going to " + event2;
                EventLine ev    = new EventLine()
                {
                    line = line2
                };
                Context.Events.Insert(ev);

                return;
            }



            case "Event3":
            {
                string event3 = "Swimming With Adi";

                string    line3 = one.FirstName + " " + one.LastName + " " + "Is going to " + event3;
                EventLine ev    = new EventLine()
                {
                    line = line3
                };
                Context.Events.Insert(ev);

                return;
            }
            }
        }
Пример #3
0
        /// <summary>
        /// Checks the current file line, and compares the contents with the previous event.
        /// </summary>
        /// <param name="line">The current line we are working with.</param>
        /// <param name="currentEvent">The current event we are comparing.</param>
        /// <param name="previousEvent">The previous event we previously managed.</param>
        /// <param name="notesList">The current event list.</param>
        /// <param name="starPowersList">The current event list.</param>
        /// <param name="keyParent">The current key parent.</param>
        internal void CheckLineContent(string line,
                                       ref NoteEvent currentEvent,
                                       ref NoteEvent previousEvent,
                                       ref List <Note> notesList,
                                       ref List <StarPower> starPowersList,
                                       string keyParent
                                       )
        {
            EventLine eventLine = new EventLine(line);

            // Create a new INoteable and process the provided line
            currentEvent = new NoteEvent(Chart, eventLine, keyParent);

            if (eventLine.Index == 5)
            {
                currentEvent.ForcedSolid = true;
            }

            if (eventLine.Index == 6)
            {
                currentEvent.IsHOPO = true;
            }

            // If there are no notes, add it to the list.
            if (notesList.Count == 0)
            {
                notesList.Add(Note.GetCopy(currentEvent));
            }


            // If previous event is null, just make a new copy.
            if (previousEvent == null)
            {
                previousEvent = (NoteEvent)currentEvent.Clone();
            }


            // If the previous starPower is on the same tick and has the same type.
            if (previousEvent.Tick == currentEvent.Tick &&
                previousEvent.Type == currentEvent.Type)
            {
                previousEvent.AppendFret(eventLine);

                if (previousEvent.Type.Contains("N"))
                {
                    if (notesList.Count - 1 >= 0)
                    {
                        notesList.RemoveAt(notesList.Count - 1);
                    }
                    notesList.Add(Note.GetCopy(previousEvent));
                }
                else
                {
                    if (starPowersList.Count - 1 >= 0)
                    {
                        starPowersList.RemoveAt(starPowersList.Count - 1);
                    }
                    starPowersList.Add(StarPower.GetCopy(previousEvent));
                }
            }

            else
            {
                /* Else if it is diferent and is a StarPower type,
                 * add it to the list and re-assign the previous starPower.*/
                if (currentEvent.Type.Contains("N"))
                {
                    currentEvent.Index = notesList.Count;
                    notesList.Add(Note.GetCopy(currentEvent));
                }
                else
                {
                    currentEvent.Index = starPowersList.Count;
                    starPowersList.Add(StarPower.GetCopy(currentEvent));
                }

                previousEvent = currentEvent;
            }
        }