Exemple #1
0
        public static void ForeachTag(TagGlobalData globalData, List <ulong> tagIds, Action <ulong, Tag> action)
        {
            if (globalData == null)
            {
                globalData = MemorySystem.memory.GetData <TagSystem, TagGlobalData>();
            }

            for (int i = 0; i < tagIds.Count; i++)
            {
                ulong tagId = tagIds[i];

                if (globalData.tags.TryGetValue(tagId, out Tag tag))
                {
                    action(tagId, tag);
                }
                else
                {
                    tagIds.RemoveAt(i--);
                }
            }
        }
Exemple #2
0
        public static void ForeachTagInGroups(TagGlobalData globalData, List <ulong> groupIds, Action <ulong, Tag> action)
        {
            if (globalData == null)
            {
                globalData = MemorySystem.memory.GetData <TagSystem, TagGlobalData>();
            }

            for (int i = 0; i < groupIds.Count; i++)
            {
                ulong groupId = groupIds[i];

                if (globalData.tagGroups.TryGetValue(groupId, out TagGroup tagGroup))
                {
                    ForeachTag(globalData, tagGroup.tagIDs, action);
                }
                else
                {
                    groupIds.RemoveAt(i--);
                }
            }
        }
Exemple #3
0
 public static bool ForeachTag(TagGlobalData globalData, List <ulong> tagIds, out (ulong id, Tag tag) tuple, TagEnumerationFunc func)