Beispiel #1
0
            /// <summary>
            /// Adds birthday and the NPC to the correct list
            /// </summary>
            internal void AddBirthday(string season, int birthday, NPC n)
            {
                List <Birthday> list = GetListOfBirthdays(season);

                if (list == null)
                {
                    monitor.Log("Failed to add birthday " + season + birthday.ToString() + " for " + n.Name, LogLevel.Error);
                    return;
                }

                // null if birthday hasn't been added
                Birthday day = list.Find(x => x.day == birthday);

                if (day == null)
                {
                    // Add the birthday
                    Birthday newDay = new Birthday(monitor, birthday);
                    newDay.AddNPC(n);
                    list.Add(newDay);
                }
                else
                {
                    // Add the npc to the existing day
                    day.AddNPC(n);
                }
            }