public void WriteXml(XmlWriter writer)
        {
            if (!string.IsNullOrWhiteSpace(GroupName))
            {
                writer.WriteAttributeString("GroupName", GroupName);
            }

            if (GroupIndex != 0)
            {
                writer.WriteAttributeString("GroupIndex", GroupIndex.ToString(CultureInfo.InvariantCulture));
            }

            writer.WriteElementString("Type", Type.ToString());
            writer.WriteElementString("Label", Label);
            writer.WriteElementString("Variable", Variable);
            writer.WriteElementString("Operator", Operator);
            writer.WriteElementString("Value", Value);
            writer.WriteElementString("HasError", HasError.ToString());
            writer.WriteElementString("TestStepHasError", TestStepHasError.ToString());
            writer.WriteElementString("MockSelected", MockSelected.ToString());

            if (!string.IsNullOrWhiteSpace(MoreLink))
            {
                writer.WriteElementString("MoreLink", MoreLink);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Bulks the index documents.
        /// </summary>
        public void BulkIndexDocuments()
        {
            List <IndexModelBase> indexableItems = new List <IndexModelBase>();

            RockContext rockContext = new RockContext();

            // return people
            var groups = new GroupService(rockContext).Queryable().AsNoTracking()
                         .Where(g =>
                                g.IsActive == true &&
                                g.GroupType.IsIndexEnabled == true);

            int recordCounter = 0;

            foreach (var group in groups)
            {
                var indexableGroup = GroupIndex.LoadByModel(group);
                indexableItems.Add(indexableGroup);

                recordCounter++;

                if (recordCounter > 100)
                {
                    IndexContainer.IndexDocuments(indexableItems);
                    indexableItems = new List <IndexModelBase>();
                    recordCounter  = 0;
                }
            }

            IndexContainer.IndexDocuments(indexableItems);
        }
        public bool GetInputTarget(out Unit unit, bool findFriend, GroupIndex groupIndex)
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out RaycastHit hit, 100, LayerMask.GetMask("Character")))
            {
                UnitGameObjectHelper unitGameObject = hit.collider.gameObject.GetComponent <UnitGameObjectHelper>();
                Log.Debug("寻找目标");
                if (unitGameObject != null)
                {
                    Unit u = UnitComponent.Instance.Get(unitGameObject.UnitId);
                    if (findFriend)
                    {
                        if (u.UnitData.groupIndex == groupIndex)
                        {
                            unit = u;
                            return(true);
                        }
                    }
                    else
                    {
                        if (u.UnitData.groupIndex != groupIndex)
                        {
                            unit = u;
                            return(true);
                        }
                    }
                }
            }
            unit = null;
            return(false);
        }
Beispiel #4
0
        protected IEnumerable <uint> GetAccounts()
        {
            IReadOnlyCollection <uint> result = Database.GetAccountIds();

            FilterTypes filteredBy = FilterTypes.empty;

            FilterTypes filteredByUnion = FilterTypes.empty;

            if (_filters.ContainsAll(FilterTypes.interests_any | FilterTypes.likes_all))
            {
                _filters = _filters.ResetFlags(FilterTypes.likes_all);
                if (likes.Count == 1)
                {
                    return(LikesIndexer.GetAllWhoLikes(likes[0]));
                }
                foreach (var likee in likes)
                {
                    _intersect.Add(LikesIndexer.GetAllWhoLikes(likee));
                }

                foreach (var interest in interestIndexes)
                {
                    _intersect.Add(StringIndexer.Interests.GetList(interest));
                }

                _filters = _filters.ResetFlags(FilterTypes.interests_any);
                return(_intersect);
            }


            if (_filters.ContainsAll(FilterTypes.fname_any | FilterTypes.sex_eq))
            {
                if (fnamesIndexes == null || fnamesIndexes.Count == 0)
                {
                    return(Array.Empty <uint>());
                }

                var probeNameList = StringIndexer.FirstNames.GetList(fnamesIndexes[0]);
                var probeSex      = Database.GetAccount(probeNameList[0]).SexStatus & SexStatus.AllSex;

                if ((probeSex & _sexStatus) == SexStatus.None)
                {
                    return(Array.Empty <uint>());
                }
            }

            if (_filters.ContainsAll(FilterTypes.birth_year) &&
                _filters.ContainsAny(FilterTypes.cities_all_types) &&
                _filters.ContainsAny(FilterTypes.sex_status_all_types))
            {
                ref StatusGroup filtered  = ref GroupIndex.SexGroupByCity(cityIndex);
                var             birthYear = (ushort)birth;
                var             list      = filtered.GetListBy(_sexStatus, birthYear, _union);
                _filters = _filters.ResetFlags(FilterTypes.birth_year | FilterTypes.cities_all_types | FilterTypes.sex_status_all_types);
                return(list);
            }
Beispiel #5
0
    public Transform GetBulletTrans(GroupIndex groupIndex, int index)
    {
        // Update index to the next one.
        int bulletIndex = 0, total = 0;

        if (groupIndex == GroupIndex.PLAYER_MAIN)
        {
            bulletIndex = plyCurrMainBulIndexList[index];
            total       = mPlyMainBulletList[index].Count - 1;

            if (bulletIndex + 1 > total)
            {
                plyCurrMainBulIndexList[index] = 0;
            }
            else
            {
                plyCurrMainBulIndexList[index]++;
            }

            return(mPlyMainBulletList[index][bulletIndex]);
        }
        else if (groupIndex == GroupIndex.PLAYER_SECONDARY)
        {
            bulletIndex = plyCurrSecondBulIndexList[index];
            total       = mPlySecondaryBulletList[index].Count - 1;

            if (bulletIndex + 1 > total)
            {
                plyCurrSecondBulIndexList[index] = 0;
            }
            else
            {
                plyCurrSecondBulIndexList[index]++;
            }

            return(mPlySecondaryBulletList[index][bulletIndex]);
        }
        else if (groupIndex == GroupIndex.ENEMY)
        {
            bulletIndex = enemyCurrBulIndexList[index];
            total       = mEnemyBulletList[index].Count - 1;

            if (bulletIndex + 1 > total)
            {
                enemyCurrBulIndexList[index] = 0;
            }
            else
            {
                enemyCurrBulIndexList[index]++;
            }

            return(mEnemyBulletList[index][bulletIndex]);
        }
        return(null);
    }
Beispiel #6
0
        /// <summary>
        /// Indexes the document.
        /// </summary>
        /// <param name="id"></param>
        public void IndexDocument(int id)
        {
            var groupEntity = new GroupService(new RockContext()).Get(id);

            // check that this group type is set to be indexed.
            if (groupEntity.GroupType.IsIndexEnabled && groupEntity.IsActive)
            {
                var indexItem = GroupIndex.LoadByModel(groupEntity);
                IndexContainer.IndexDocument(indexItem);
            }
        }
Beispiel #7
0
        /// <summary>
        /// Deletes the indexed documents by group type.
        /// </summary>
        /// <param name="groupTypeId">The group type identifier.</param>
        public void DeleteIndexedDocumentsByGroupType(int groupTypeId)
        {
            var groups = new GroupService(new RockContext()).Queryable()
                         .Where(i => i.GroupTypeId == groupTypeId);

            foreach (var group in groups)
            {
                var indexableGroup = GroupIndex.LoadByModel(group);
                IndexContainer.DeleteDocument <GroupIndex>(indexableGroup);
            }
        }
Beispiel #8
0
        private void Update(EvaluationContext context)
        {
            if (!_initialized)
            {
                if (Parent?.Symbol == null)
                {
                    Log.Warning("Can't register Preset blending for undefined parent", this.SymbolChildId);
                    return;
                }
                BlendSettingForCompositionIds[Parent.Symbol.Id] = _blendSetting;
                _initialized = true;
            }

            // Evaluate subtree
            SubTree.GetValue(context);

            var wasUpdated = false;
            var groupIndex = GroupIndex.GetValue(context);

            if (groupIndex != _blendSetting.GroupIndex)
            {
                wasUpdated = true;
                _blendSetting.GroupIndex = groupIndex;
            }

            var presetA = PresetA.GetValue(context);

            if (presetA != _blendSetting.PresetAIndex)
            {
                wasUpdated = true;
                _blendSetting.PresetAIndex = presetA;
            }

            var presetB = PresetB.GetValue(context);

            if (presetB != _blendSetting.PresetBIndex)
            {
                wasUpdated = true;
                _blendSetting.PresetBIndex = presetB;
            }

            var blendFactor = BlendFactor.GetValue(context);

            if (Math.Abs(blendFactor - _blendSetting.BlendFactor) > 0.001f)
            {
                wasUpdated = true;
                _blendSetting.BlendFactor = blendFactor;
            }

            _blendSetting.WasActivatedLastFrame = wasUpdated;
        }
Beispiel #9
0
        public override bool Equals(object obj)
        {
            Student another = (Student)obj;

            return(Surname.ToLower().Equals(another.Surname.ToLower()) &&
                   Name.ToLower().Equals(another.Name.ToLower()) &&
                   Patronymic.ToLower().Equals(another.Patronymic.ToLower()) &&
                   DateOfBirth.Equals(another.DateOfBirth) &&
                   EnterDate.Equals(another.EnterDate) &&
                   GroupIndex.ToLower().Equals(another.GroupIndex.ToLower()) &&
                   Faculty.ToLower().Equals(another.Faculty.ToLower()) &&
                   Specialty.ToLower().Equals(another.Specialty.ToLower()) &&
                   AcademicPerformance == another.AcademicPerformance);
        }
Beispiel #10
0
        public override bool Equals(object obj)
        {
            Student another = (Student)obj;

            return(LastName.ToLower().Equals(another.LastName.ToLower()) &&
                   FirstName.ToLower().Equals(another.FirstName.ToLower()) &&
                   Patronymic.ToLower().Equals(another.Patronymic.ToLower()) &&
                   BirthDate.Equals(another.BirthDate) &&
                   EnterDate.Equals(another.EnterDate) &&
                   GroupIndex.ToLower().Equals(another.GroupIndex.ToLower()) &&
                   Faculty.ToLower().Equals(another.Faculty.ToLower()) &&
                   Specialization.ToLower().Equals(another.Specialization.ToLower()) &&
                   Performance == another.Performance);
        }
Beispiel #11
0
 public void SetNextMinionMovement(GroupIndex groupIndex)
 {
     if (groupIndex == GroupIndex.MINION_1)
     {
         AddAttackAndMovementToNextPrefab(mEnemyMinion1InfoList, mEnemyMinion1List, ref mMinion1SetIndex, ref mMinion1SavedSetIndex);
     }
     else if (groupIndex == GroupIndex.MINION_2)
     {
         AddAttackAndMovementToNextPrefab(mEnemyMinion2InfoList, mEnemyMinion2List, ref mMinion2SetIndex, ref mMinion2SavedSetIndex);
     }
     else if (groupIndex == GroupIndex.MINION_3)
     {
         AddAttackAndMovementToNextPrefab(mEnemyMinion3InfoList, mEnemyMinion3List, ref mMinion3SetIndex, ref mMinion3SavedSetIndex);
     }
 }
Beispiel #12
0
        public void Test_Maven_Google_GroupIndex_GetGroupNamesAsync()
        {
            GroupIndex gi = new GroupIndex("androidx.car");

            IEnumerable <(string name, string[] versions)> groups = gi.GetArtifactNamesAndVersionsAsync()
                                                                    .Result;

            #if MSTEST
            Assert.IsNotNull(gi);
            #elif NUNIT
            Assert.NotNull(gi);
            #elif XUNIT
            Assert.NotNull(gi);
            #endif

            return;
        }
Beispiel #13
0
        /// <summary>
        /// Bulks the index documents by content channel.
        /// </summary>
        /// <param name="groupTypeId">The content channel identifier.</param>
        public void BulkIndexDocumentsByGroupType(int groupTypeId)
        {
            List <GroupIndex> indexableGroups = new List <GroupIndex>();

            // return all approved content channel items that are in content channels that should be indexed
            RockContext rockContext = new RockContext();
            var         groups      = new GroupService(rockContext).Queryable()
                                      .Where(g =>
                                             g.GroupTypeId == groupTypeId &&
                                             g.IsActive);

            foreach (var group in groups)
            {
                var indexableChannelItem = GroupIndex.LoadByModel(group);
                indexableGroups.Add(indexableChannelItem);
            }

            IndexContainer.IndexDocuments(indexableGroups);
        }
Beispiel #14
0
 public void SetBulletTag(GroupIndex groupIndex, int index, string tag)
 {
     if (groupIndex == GroupIndex.PLAYER_MAIN)
     {
         for (int i = 0; i < mPlyMainBulletList[index].Count; i++)
         {
             mPlyMainBulletList[index][i].tag = tag;
         }
     }
     else if (groupIndex == GroupIndex.PLAYER_SECONDARY)
     {
         for (int i = 0; i < mPlySecondaryBulletList[index].Count; i++)
         {
             mPlySecondaryBulletList[index][i].tag = tag;
         }
     }
     else if (groupIndex == GroupIndex.ENEMY)
     {
         for (int i = 0; i < mEnemyBulletList[index].Count; i++)
         {
             mEnemyBulletList[index][i].tag = tag;
         }
     }
 }