예제 #1
0
        internal void RestoreGroup(Guid groupId)
        {
            var group = new PlayerTimersGroup(groupId.ToString(),
                                              this,
                                              wurmApi,
                                              logger,
                                              soundManager,
                                              trayPopups,
                                              timerDefinitions,
                                              timerInstances);

            playerTimersGroupsResolver.LoadAndStartTracking(group);
            try
            {
                group.Initialize();
            }
            finally
            {
                if (!timerGroups.Contains(group))
                {
                    timerGroups.Add(group);
                }
                currentGroupsIds.Add(groupId);

                FlagAsChanged();
            }
        }
예제 #2
0
        internal void CreateGroup(Guid groupId, string characterName, string serverGroupId)
        {
            var group = new PlayerTimersGroup(groupId.ToString(),
                                              this,
                                              wurmApi,
                                              logger,
                                              soundManager,
                                              trayPopups,
                                              timerDefinitions,
                                              timerInstances);

            playerTimersGroupsResolver.LoadAndStartTracking(group);

            group.CharacterName = characterName;
            group.ServerGroupId = serverGroupId;

            group.Initialize();

            timerGroups.Add(group);
            currentGroupsIds.Add(groupId);

            FlagAsChanged();
        }