示例#1
0
文件: FType.cs 项目: hwacha/SemInC
    public FType(ISemanticType basetype, LogicalForm formula)
    {
        if (!formula.IsFormula() || formula.IsClosed())
        {
            System.Console.WriteLine("FType failed: not a formula, or not free");
            return;
            // error
        }
        HashSet <Variable> .Enumerator vars = formula.GetFreeVariables().GetEnumerator();
        vars.MoveNext();
        Variable first = vars.Current;

        if (vars.MoveNext())
        {
            System.Console.WriteLine("FType failed: more than one free variable");
            return;
            // error (more than one free variable)
        }

        if (!first.GetSemanticType().Equals(basetype))
        {
            System.Console.WriteLine(first.GetSemanticType());
            System.Console.WriteLine(basetype);

            System.Console.WriteLine("FType failed: types aren't equal");
            return;
            // error
        }
        this.basetype = basetype;
        this.formula  = formula;
    }
        public void StartDialogue(int inGroupId)
        {
            string ageActName = this.m_ageActName;

            this.EndDialogue();
            this.m_ageActName    = ageActName;
            this.m_actorLinesRaw = GameDataMgr.actorLinesDatabin.GetDataByKey(inGroupId);
            if (this.m_actorLinesRaw == null)
            {
                return;
            }
            ResActorLinesInfo dataByKeySingle = GameDataMgr.actorLinesDatabin.GetDataByKeySingle((uint)inGroupId);

            if (dataByKeySingle == null)
            {
                return;
            }
            if (CSysDynamicBlock.bDialogBlock && dataByKeySingle.bIOSHide != 0)
            {
                return;
            }
            this.m_actorLines = new DialogueProcessor.SActorLineNode[this.m_actorLinesRaw.get_Count()];
            DialogueProcessor.SActorLineNode sActorLineNode = default(DialogueProcessor.SActorLineNode);
            this.TranslateNodeFromRaw(ref sActorLineNode, ref dataByKeySingle);
            this.m_actorLines[0] = sActorLineNode;
            HashSet <object> .Enumerator enumerator = this.m_actorLinesRaw.GetEnumerator();
            if (enumerator.MoveNext())
            {
                int num = 1;
                while (enumerator.MoveNext())
                {
                    ResActorLinesInfo resActorLinesInfo = enumerator.get_Current() as ResActorLinesInfo;
                    DialogueProcessor.SActorLineNode sActorLineNode2 = default(DialogueProcessor.SActorLineNode);
                    this.TranslateNodeFromRaw(ref sActorLineNode2, ref resActorLinesInfo);
                    this.m_actorLines[num] = sActorLineNode2;
                    sActorLineNode         = sActorLineNode2;
                    num++;
                }
            }
            Singleton <CBattleGuideManager> .GetInstance().PauseGame(this, true);

            this.m_curIndex = -1;
            if (this.bAutoNextPage)
            {
                base.StartCoroutine(this.NextPageNoTimeScale());
            }
            else
            {
                this.NextPageInternal();
            }
            if (this.PreDialogId != 0 && inGroupId == this.PreDialogId)
            {
                PreDialogStartedEventParam preDialogStartedEventParam = new PreDialogStartedEventParam(this.PreDialogId);
                Singleton <GameEventSys> .get_instance().SendEvent <PreDialogStartedEventParam>(GameEventDef.Event_PreDialogStarted, ref preDialogStartedEventParam);

                this.PreDialogId = 0;
            }
        }
        /// <summary>
        /// Arrange this instance.
        /// </summary>
        /// <exception cref="DisruptedRouteException"><see cref="T:DeliveryRouteHelper.Segment"/>s doesn't form a complete chain.</exception>
        public void Arrange()
        {
            // Already arranged segments will be added there piece by piece on every new iteration
            LinkedList <Segment> chained = new LinkedList <Segment>();
            // Already arranged segments will be removed from this set on every new iteration
            HashSet <Segment> notChained = new HashSet <Segment>();

            // Initially, 'chained' contains one random segment (first) and 'notChained' all remaining
            HashSet <Segment> .Enumerator enumerator = segmentsSet.GetEnumerator();
            enumerator.MoveNext();
            chained.AddFirst(enumerator.Current);
            while (enumerator.MoveNext())
            {
                notChained.Add(enumerator.Current);
            }

            int chainedCountPrev = chained.Count;

            // No 'notChained' segments left means that we are successfully arranged them all
            while (notChained.Count != 0)  // O(1)
            {
                // This is in fact a loop through all 'notChained' elements where we attach matching segments
                // to the head (or tail) of the route (presented in its current state) and remove them from
                // the 'notChained' at the same time. If the current segment doesn't fit niether head or tail
                // it will be left in the 'notChained' to be inspected at the next step.
                //
                // O(N), but N is decreasing on each 'while' step (worst case: arithmetic progression from
                // (N-1) to 1)
                notChained.RemoveWhere((Segment segment) =>
                {
                    if (segment.Start == chained.Last.Value.End) // O(1)
                    {
                        chained.AddLast(segment);                // O(1)
                        return(true);
                    }
                    if (segment.End == chained.First.Value.Start) // O(1)
                    {
                        chained.AddFirst(segment);                // O(1)
                        return(true);
                    }
                    return(false);
                });

                // Not changed length of any of the two arrays means that we miss some segments and
                // the route is not arrangeable
                if (chained.Count == chainedCountPrev) // O(1)
                {
                    route.Clear();                     // just in case it was filled somehow
                    throw new DisruptedRouteException("Cannot arrange segments into route");
                }

                chainedCountPrev = chained.Count;
            }

            route = chained;  // Assume O(1) (as LinkedList<T> is a reference type)
        }
示例#4
0
        public Dictionary <string, string> GetReturnDataValues(ISequenceFlowContainer sequence)
        {
            Dictionary <string, string> returnDataValues = new Dictionary <string, string>(_context.ReturnVariables.Count);

            if (_context.ReturnVariables.Count == 0)
            {
                return(returnDataValues);
            }

            string nameRegex = CoreUtils.GetVariableNameRegex(sequence, _context.SessionId);
            Regex  regex     = new Regex(nameRegex);

            string varName = "";

            HashSet <string> .Enumerator returnEnumerator = _context.ReturnVariables.GetEnumerator();
            bool   hasNext = returnEnumerator.MoveNext();
            string varValueStr;

            while (hasNext)
            {
                try
                {
                    while (hasNext)
                    {
                        varName = returnEnumerator.Current;
                        hasNext = returnEnumerator.MoveNext();
                        // 如果不匹配序列,则跳过
                        if (!regex.IsMatch(varName))
                        {
                            continue;
                        }
                        object varValue = _variables[varName];
                        GetVariableStringValue(varValue, out varValueStr);
                        returnDataValues.Add(varName, varValueStr);
                    }
                }
                catch (Exception ex)
                {
                    _context.LogSession.Print(LogLevel.Warn, CommonConst.PlatformSession, ex, $"Deserialize variable '{varName}' error.");
                    returnDataValues.Add(varName, CoreConstants.ErrorVarValue);
                }
            }

            bool getLock = false;

            _keyVarLock.Enter(ref getLock);
            foreach (string returnVar in returnDataValues.Keys)
            {
                _context.ReturnVariables.Remove(returnVar);
            }
            _keyVarLock.Exit();

            return(returnDataValues);
        }
        /// <exception cref="InvalidOperationException"></exception>
        public void testConfigLoad()
        {
            ServerConfigurationReader reader        = new StaxServerConfigurationReader();
            ServerConfiguration       configuration = reader.read();

            HashSet <CorrelationSet> .Enumerator valCorrelationSets    = configuration.getCorrelationSets().GetEnumerator();
            HashSet <String> .Enumerator         valClientApplications = configuration.getClientApplications().GetEnumerator();

            Assert.AreEqual(3, configuration.getCorrelationSets().Count);

            valCorrelationSets.MoveNext();
            valClientApplications.MoveNext();
            Assert.AreEqual("server1", valCorrelationSets.Current.getClientApplications().GetEnumerator);


            //		Assert.AreEqual("org.owasp.appsensor.analysis.ReferenceEventAnalysisEngine", configuration.getEventAnalysisEngineImplementation());
            //		Assert.AreEqual("org.owasp.appsensor.analysis.ReferenceAttackAnalysisEngine", configuration.getAttackAnalysisEngineImplementation());
            //		Assert.AreEqual("org.owasp.appsensor.analysis.ReferenceResponseAnalysisEngine", configuration.getResponseAnalysisEngineImplementation());
            //
            //		Assert.AreEqual("org.owasp.appsensor.storage.InMemoryEventStore", configuration.getEventStoreImplementation());
            //		Assert.AreEqual("org.owasp.appsensor.storage.InMemoryAttackStore", configuration.getAttackStoreImplementation());
            //		Assert.AreEqual("org.owasp.appsensor.storage.InMemoryResponseStore", configuration.getResponseStoreImplementation());
            //
            //		Assert.AreEqual("org.owasp.appsensor.logging.Slf4jLogger", configuration.getLoggerImplementation());
            //
            //		Assert.AreEqual("org.owasp.appsensor.accesscontrol.ReferenceAccessController", configuration.getAccessControllerImplementation());
            //
            //		Assert.AreEqual(2, configuration.getEventStoreObserverImplementations().Count);
            //		Assert.AreEqual("org.owasp.appsensor.analysis.ReferenceEventAnalysisEngine", configuration.getEventStoreObserverImplementations().iterator().next());
            //
            //		Assert.AreEqual(2, configuration.getAttackStoreObserverImplementations().Count);
            //		Assert.AreEqual("org.owasp.appsensor.analysis.ReferenceAttackAnalysisEngine", configuration.getAttackStoreObserverImplementations().iterator().next());
            //
            //		Assert.AreEqual(2, configuration.getResponseStoreObserverImplementations().Count);
            //		Assert.AreEqual("org.owasp.appsensor.analysis.ReferenceResponseAnalysisEngine", configuration.getResponseStoreObserverImplementations().iterator().next());

            HashSet <DetectionPoint> .Enumerator valDetectionPoints = configuration.getDetectionPoints().GetEnumerator();

            Assert.AreEqual(5, configuration.getDetectionPoints().Count);
            valDetectionPoints.MoveNext();
            Assert.AreEqual("IE1", valDetectionPoints.Current.getId());
            valDetectionPoints.MoveNext();
            Assert.AreEqual(4, valDetectionPoints.Current.getThreshold().getInterval().getDuration());
            valDetectionPoints.MoveNext();
            Assert.AreEqual("minutes", valDetectionPoints.Current.getThreshold().getInterval().getUnit());

            valDetectionPoints.MoveNext();
            Assert.AreEqual(5, valDetectionPoints.Current.getResponses().Count);
            valDetectionPoints.MoveNext();
            Assert.AreEqual("log", valDetectionPoints.Current.getResponses().iterator().next().getAction());
        }
        private void ThreadProc()
        {
            while (!disposing)
            {
                if (inputProvider != null)
                {
                    ContactInfo[] contacts = inputProvider.GetContacts();
                    legacySupportLogic.Process(contacts);

                    if (contacts.Length > 0)
                    {
                        HashSet <IMultitouchServiceCallback> .Enumerator enumerator = callbacks.GetEnumerator();
                        List <IMultitouchServiceCallback> failed = new List <IMultitouchServiceCallback>();
                        while (enumerator.MoveNext())
                        {
                            try
                            {
                                enumerator.Current.ProcessContact(contacts);
                            }
                            catch (Exception)
                            {
                                failed.Add(enumerator.Current);
                            }
                        }
                        foreach (IMultitouchServiceCallback failedCallback in failed)
                        {
                            callbacks.Remove(failedCallback);
                        }
                    }
                }
            }
        }
        public UsCmd CreateTextureCmd()
        {
            UsCmd usCmd = new UsCmd();

            usCmd.WriteNetCmd(eNetCmd.SV_FrameData_Texture);
            usCmd.WriteInt32(this.VisibleTextures.Count);
            using (Dictionary <Texture, HashSet <Material> > .Enumerator enumerator1 = this.VisibleTextures.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    KeyValuePair <Texture, HashSet <Material> > current1 = enumerator1.Current;
                    usCmd.WriteInt32(((Object)current1.Key).GetInstanceID());
                    usCmd.WriteStringStripped(((Object)current1.Key).get_name());
                    usCmd.WriteString(string.Format("{0}x{1}", (object)current1.Key.get_width(), (object)current1.Key.get_height()));
                    usCmd.WriteString(UsTextureUtil.FormatSizeString(this._textureSizeLut[current1.Key] / 1024));
                    usCmd.WriteInt32(current1.Value.Count);
                    using (HashSet <Material> .Enumerator enumerator2 = current1.Value.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            Material current2 = enumerator2.Current;
                            usCmd.WriteInt32(((Object)current2).GetInstanceID());
                        }
                    }
                }
            }
            return(usCmd);
        }
        public UsCmd CreateMaterialCmd()
        {
            UsCmd usCmd = new UsCmd();

            usCmd.WriteNetCmd(eNetCmd.SV_FrameData_Material);
            usCmd.WriteInt32(this.VisibleMaterials.Count);
            using (Dictionary <Material, HashSet <GameObject> > .Enumerator enumerator1 = this.VisibleMaterials.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    KeyValuePair <Material, HashSet <GameObject> > current1 = enumerator1.Current;
                    usCmd.WriteInt32(((Object)current1.Key).GetInstanceID());
                    usCmd.WriteStringStripped(((Object)current1.Key).get_name());
                    usCmd.WriteStringStripped(((Object)current1.Key.get_shader()).get_name());
                    usCmd.WriteInt32(current1.Value.Count);
                    using (HashSet <GameObject> .Enumerator enumerator2 = current1.Value.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            GameObject current2 = enumerator2.Current;
                            usCmd.WriteInt32(((Object)current2).GetInstanceID());
                        }
                    }
                }
            }
            return(usCmd);
        }
示例#9
0
    // based on affinity with the other, calculates the corresponding emotional state based on distance
    //FIXME this method is not currently using the distance parameter, and requires to used only with
    // immediate neighbours
    private Mood sense(Personality other)
    {
        Mood finalMood = new Mood();

        if (other.traits.Count != this.traits.Count)
        {
            Debug.LogError("Incompatible personalities!");
            moodHandler.SetNextMood(finalMood);
        }
        List <Trait> .Enumerator loop1 = traits.GetEnumerator();
        List <Trait> .Enumerator loop2 = other.traits.GetEnumerator();
        HashSet <PersonalityFactor> .Enumerator modelLoop = model.Factors.GetEnumerator();

        while (modelLoop.MoveNext() & loop1.MoveNext() && loop2.MoveNext())
        {
            Trait mine = loop1.Current;
            Trait his  = loop2.Current;
            finalMood += modelLoop.Current.confront(mine, his);
        }
        if (finalMood.getFeel() == Mood.Feeling.SAD || finalMood.getFeel() == Mood.Feeling.PERPLEX)
        {
            // Debug.Log("Mood TieBreak for "+this);
            finalMood = Mood.HAPPY;
        }

        return(finalMood);
    }
示例#10
0
        /// <summary>
        /// 根据名称获取类型
        /// </summary>
        /// <param name="controllerName"></param>
        /// <param name="namespaces"></param>
        /// <returns></returns>
        public ICollection <Type> GetControllerTypes(string controllerName, HashSet <string> namespaces)
        {
            HashSet <Type>         hashSet = new HashSet <Type>();
            ILookup <string, Type> lookup;

            if (this._cache.TryGetValue(controllerName, out lookup))
            {
                if (namespaces != null)
                {
                    using (HashSet <string> .Enumerator enumerator = namespaces.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            string current = enumerator.Current;
                            foreach (IGrouping <string, Type> current2 in lookup)
                            {
                                if (ControllerTypeCache.IsNamespaceMatch(current, current2.Key))
                                {
                                    hashSet.UnionWith(current2);
                                }
                            }
                        }
                        return(hashSet);
                    }
                }
                foreach (IGrouping <string, Type> current3 in lookup)
                {
                    hashSet.UnionWith(current3);
                }
            }
            return(hashSet);
        }
        private bool CheckReceiver(ResVoiceInteraction InInteractionCfg, HashSet <int> InOwnerCamps)
        {
            int hostPlayerCamp = Singleton <GamePlayerCenter> .get_instance().hostPlayerCamp;

            if (InInteractionCfg.bSpecialReceive != 0)
            {
                for (int i = 0; i < InInteractionCfg.SpecialReceiveConditions.Length; i++)
                {
                    if (InInteractionCfg.SpecialReceiveConditions[i] == 0u)
                    {
                        break;
                    }
                    int inCfgID = (int)InInteractionCfg.SpecialReceiveConditions[i];
                    if (InInteractionCfg.bReceiveType == 100)
                    {
                        if (this.HasReceiver(inCfgID))
                        {
                            return(true);
                        }
                    }
                    else if (InInteractionCfg.bReceiveType == 0)
                    {
                        if (this.HasReceiverInCamp(inCfgID, hostPlayerCamp))
                        {
                            return(true);
                        }
                    }
                    else if (InInteractionCfg.bReceiveType == 1 && this.HasReceiverNotInCamp(inCfgID, hostPlayerCamp))
                    {
                        return(true);
                    }
                }
            }
            else
            {
                if (InInteractionCfg.bReceiveType == 100)
                {
                    return(true);
                }
                if (InInteractionCfg.bReceiveType == 0)
                {
                    if (InOwnerCamps.Contains(hostPlayerCamp))
                    {
                        return(true);
                    }
                }
                else if (InInteractionCfg.bReceiveType == 1)
                {
                    HashSet <int> .Enumerator enumerator = InOwnerCamps.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        if (enumerator.get_Current() != hostPlayerCamp)
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
示例#12
0
        private int getSyokusetuPlane(Dictionary <Mst_slotitem, HashSet <Mem_ship> > touchItems)
        {
            IOrderedEnumerable <Mst_slotitem> orderedEnumerable = Enumerable.OrderByDescending <Mst_slotitem, int>(touchItems.get_Keys(), (Mst_slotitem x) => x.Houm);

            using (IEnumerator <Mst_slotitem> enumerator = orderedEnumerable.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Mst_slotitem current      = enumerator.get_Current();
                    Mst_slotitem mst_slotitem = current;
                    using (HashSet <Mem_ship> .Enumerator enumerator2 = touchItems.get_Item(current).GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            Mem_ship current2 = enumerator2.get_Current();
                            double   num      = Math.Sqrt((double)mst_slotitem.Saku);
                            double   num2     = Math.Sqrt((double)current2.Level);
                            int      num3     = (int)(num * num2);
                            if (num3 > this.randInstance.Next(25))
                            {
                                return(mst_slotitem.Id);
                            }
                        }
                    }
                }
            }
            return(0);
        }
示例#13
0
 private static void WriteStaticallyLinkedModuleRegistration(TextWriter w, HashSet <string> nativeModules, HashSet <string> nativeClasses)
 {
     w.WriteLine("struct ClassRegistrationContext;");
     w.WriteLine("void InvokeRegisterStaticallyLinkedModuleClasses(ClassRegistrationContext& context)");
     w.WriteLine("{");
     if (nativeClasses == null)
     {
         w.WriteLine("\tvoid RegisterStaticallyLinkedModuleClasses(ClassRegistrationContext&);");
         w.WriteLine("\tRegisterStaticallyLinkedModuleClasses(context);");
     }
     else
     {
         w.WriteLine("\t// Do nothing (we're in stripping mode)");
     }
     w.WriteLine("}");
     w.WriteLine();
     w.WriteLine("void RegisterStaticallyLinkedModulesGranular()");
     w.WriteLine("{");
     using (HashSet <string> .Enumerator enumerator = nativeModules.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             string current = enumerator.Current;
             w.WriteLine("\tvoid RegisterModule_" + current + "();");
             w.WriteLine("\tRegisterModule_" + current + "();");
             w.WriteLine();
         }
     }
     w.WriteLine("}");
 }
 private void Cleanup()
 {
     if (Object.op_Implicit((Object)this.TranslucencyPropsTex))
     {
         Object.DestroyImmediate((Object)this.TranslucencyPropsTex);
         this.TranslucencyPropsTex = (Texture2D)null;
     }
     if (this.combufPreLight != null)
     {
         if (Object.op_Implicit((Object)this.mycam))
         {
             this.mycam.RemoveCommandBuffer((CameraEvent)21, this.combufPreLight);
             this.mycam.RemoveCommandBuffer((CameraEvent)7, this.combufPostLight);
         }
         using (HashSet <Camera> .Enumerator enumerator = this.sceneCamsWithBuffer.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Camera current = enumerator.Current;
                 if (Object.op_Implicit((Object)current))
                 {
                     current.RemoveCommandBuffer((CameraEvent)21, this.combufPreLight);
                     current.RemoveCommandBuffer((CameraEvent)7, this.combufPostLight);
                 }
             }
         }
     }
     this.sceneCamsWithBuffer.Clear();
     // ISSUE: method pointer
     Camera.onPreRender = (__Null)Delegate.Remove((Delegate)Camera.onPreRender, (Delegate) new Camera.CameraCallback((object)this, __methodptr(SetupCam)));
 }
示例#15
0
 protected void LateUpdate()
 {
     for (int i = 0; i < this.ignoredColliders.Count; i++)
     {
         KeyValuePair <Collider, List <Collider> > byIndex = this.ignoredColliders.GetByIndex(i);
         Collider        key   = byIndex.Key;
         List <Collider> value = byIndex.Value;
         if (key == null)
         {
             int num = i;
             i = num - 1;
             this.ignoredColliders.RemoveAt(num);
         }
         else if (value.Count == 0)
         {
             HashSet <Collider> .Enumerator enumerator = this.waterColliders.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 Physics.IgnoreCollision(key, enumerator.Current, false);
             }
             int num1 = i;
             i = num1 - 1;
             this.ignoredColliders.RemoveAt(num1);
         }
     }
 }
示例#16
0
        public static T GetOnlyElement <T>(ICollection <T> coll)
        {
            if (coll.Count != 1)
            {
                throw new InvalidOperationException("Count: " + coll.Count);
            }
            List <T> list = coll as List <T>;

            if (list != null)
            {
                return(list[0]);
            }
            HashSet <T> set = coll as HashSet <T>;

            if (set != null)
            {
                HashSet <T> .Enumerator enumerator = set.GetEnumerator();
                enumerator.MoveNext();
                return(enumerator.Current);
            }
            IEnumerator <T> enumerator2 = coll.GetEnumerator();

            enumerator2.MoveNext();
            return(enumerator2.Current);
        }
        public static Rect GetScreenPos(UnityEngine.Object client, string text, GUIStyle style)
        {
            if (CinemachineGameWindowDebug.mClients == null)
            {
                CinemachineGameWindowDebug.mClients = new HashSet <UnityEngine.Object>();
            }
            if (!CinemachineGameWindowDebug.mClients.Contains(client))
            {
                CinemachineGameWindowDebug.mClients.Add(client);
            }
            Vector2 position = new Vector2(0f, 0f);
            Vector2 vector   = style.CalcSize(new GUIContent(text));

            if (CinemachineGameWindowDebug.mClients != null)
            {
                using (HashSet <UnityEngine.Object> .Enumerator enumerator = CinemachineGameWindowDebug.mClients.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        if (enumerator.Current == client)
                        {
                            break;
                        }
                        position.y += vector.y;
                    }
                }
            }
            return(new Rect(position, vector));
        }
示例#18
0
        /// <summary>
        /// Search File By File Path in the BlockGet File System.
        /// </summary>
        /// <param name="filepath"></param>
        /// <returns>Boolean if found or not</returns>
        public bool SearchFileByPathBlockgetFS(string RequiredFile)
        {
            bool result = false;

            lock (LockAllFileList)
            {
                using (HashSet <List <string> > .Enumerator lEnumerator = listFileNamesCids.GetEnumerator())
                {
                    while (lEnumerator.MoveNext() && !result)
                    {
                        result = lEnumerator.Current.Contains(RequiredFile);
                        if (result)
                        {
                            Console.WriteLine("The item {0} has been found in the Blockget File System.", RequiredFile);
                            //Check Current
                            string filepath = GetPathFileEntry(lEnumerator.Current);
                            if (!String.IsNullOrEmpty(filepath))
                            {
                                //Form1.setImage(filepath);
                                Console.WriteLine("Here: " + filepath);
                            }
                            else
                            {
                                Console.WriteLine("Couldn't get the filepath of the file for thumbnail update");
                            }
                        }
                    }
                }
            }
            return(result);
        }
示例#19
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.m_Disposed && this.m_Channels != null)
     {
         for (int index = 0; index < this.m_Channels.Length; ++index)
         {
             this.m_Channels[index].Dispose();
         }
     }
     this.m_Channels = (ChannelBuffer[])null;
     if (this.m_ClientOwnedObjects != null)
     {
         using (HashSet <NetworkInstanceId> .Enumerator enumerator = this.m_ClientOwnedObjects.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 GameObject localObject = NetworkServer.FindLocalObject(enumerator.Current);
                 if ((UnityEngine.Object)localObject != (UnityEngine.Object)null)
                 {
                     localObject.GetComponent <NetworkIdentity>().ClearClientOwner();
                 }
             }
         }
     }
     this.m_ClientOwnedObjects = (HashSet <NetworkInstanceId>)null;
     this.m_Disposed           = true;
 }
示例#20
0
 public static void GenerateDependencies(string strippedAssemblyDir, string icallsListFile, RuntimeClassRegistry rcr, out HashSet <string> nativeClasses, out HashSet <string> nativeModules)
 {
     string[] userAssemblies = CodeStrippingUtils.GetUserAssemblies(strippedAssemblyDir);
     nativeClasses = !PlayerSettings.stripEngineCode ? (HashSet <string>)null : CodeStrippingUtils.GenerateNativeClassList(rcr, strippedAssemblyDir, userAssemblies);
     if (nativeClasses != null)
     {
         CodeStrippingUtils.ExcludeModuleManagers(ref nativeClasses);
     }
     nativeModules = CodeStrippingUtils.GetNativeModulesToRegister(nativeClasses);
     if (nativeClasses != null && icallsListFile != null)
     {
         HashSet <string> modulesFromIcalls = CodeStrippingUtils.GetModulesFromICalls(icallsListFile);
         int classId = BaseObjectTools.StringToClassID("GlobalGameManager");
         using (HashSet <string> .Enumerator enumerator = modulesFromIcalls.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 foreach (int moduleClass in ModuleMetadata.GetModuleClasses(enumerator.Current))
                 {
                     if (BaseObjectTools.IsDerivedFromClassID(moduleClass, classId))
                     {
                         nativeClasses.Add(BaseObjectTools.ClassIDToString(moduleClass));
                     }
                 }
             }
         }
         nativeModules.UnionWith((IEnumerable <string>)modulesFromIcalls);
     }
     new AssemblyReferenceChecker().CollectReferencesFromRoots(strippedAssemblyDir, (IEnumerable <string>)userAssemblies, true, 0.0f, true);
 }
示例#21
0
    public static GameObject instantiate(Block block)
    {
        if (!gopool.ContainsKey(block.getMeshID()))
        {
            gopool.Add(block.getMeshID(), new HashSet <GameObject>());
        }
        if (gopool[block.getMeshID()].Count == 0)
        {
            instantiations++;
            GameObject retval = ((Transform)Instantiate(BlockFactory.block[block.getMeshID()], block.getPosition(), Quaternion.identity)).gameObject;
            return(retval);
        }
        HashSet <GameObject> .Enumerator it = gopool[block.getMeshID()].GetEnumerator();
        it.MoveNext();
        GameObject go = it.Current;

        it.Dispose();
        gopool[block.getMeshID()].Remove(go);
        go.transform.position = block.getPosition();
        go.SetActive(false);
        go.SetActive(true);
        go.GetComponent <MeshRenderer>().enabled = true;
        poolUsages++;
        poolSize--;
        return(go);
    }
示例#22
0
 /// <summary>
 /// 列挙を次に進める
 /// </summary>
 /// <exception cref="InvalidOperationException">列挙中にコレクションが変更された</exception>
 /// <returns>列挙を次に進められたらtrue,それ以外でfalse</returns>
 public bool MoveNext()
 {
     ThrowIfChanged();
     if (set == null || index == set.Count)
     {
         if (!enumerator.MoveNext())
         {
             return(MoveNextRare());
         }
         set            = enumerator.Current.Value;
         enumerator_set = set.GetEnumerator();
         index          = 0;
     }
     if (index < set.Count)
     {
         if (!enumerator_set.MoveNext())
         {
             throw new InvalidOperationException("列挙に失敗しました");
         }
         Current = enumerator_set.Current;
         index++;
         return(true);
     }
     return(MoveNextRare());
 }
示例#23
0
    public void imethod_0(HashSet <string> hashSet_0 = null)
    {
        object obj = this.object_0;

        lock (obj)
        {
            if (hashSet_0 != null)
            {
                using (HashSet <string> .Enumerator enumerator = hashSet_0.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        string text = enumerator.Current;
                        GClass883.GClass884 gclass;
                        if (!this.method_0().TryGetValue(text, out gclass))
                        {
                            gclass = new GClass883.GClass884(text, false);
                        }
                        gclass.method_2(true);
                        this.method_0().Remove(text);
                    }
                    return;
                }
            }
            GClass883.GClass884 gclass2 = new GClass883.GClass884("127.0.0.1", false);
            this.imethod_0(gclass2.method_3());
        }
    }
        public static void GenerateRegisterModules(RuntimeClassRegistry allClasses, TextWriter output, bool strippingEnabled)
        {
            allClasses.SynchronizeClasses();
            HashSet <string> modulesToRegister = CodeStrippingUtils.GetNativeModulesToRegister(!strippingEnabled ? (HashSet <string>)null : new HashSet <string>((IEnumerable <string>)allClasses.GetAllNativeClassesAsString()));

            modulesToRegister.Add("IMGUI");
            using (HashSet <string> .Enumerator enumerator = modulesToRegister.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    output.WriteLine("\textern \"C\" void RegisterModule_" + current + "();");
                }
            }
            output.WriteLine("void RegisterStaticallyLinkedModules()");
            output.WriteLine("{");
            using (HashSet <string> .Enumerator enumerator = modulesToRegister.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    output.WriteLine("\tRegisterModule_" + current + "();");
                }
            }
            output.WriteLine("}");
        }
示例#25
0
    public void OnRenderObject()
    {
        if (!RenderEnabled || AdaptiveConnections.Count <= 0)
        {
            return;
        }

        if (PreviewTex.IsPreview)
        {
            return;
        }

        lineMaterial.SetPass(0);

        GL.PushMatrix();
        GL.MultMatrix(transform.localToWorldMatrix);

        GL.Begin(GL.LINES);

        HashSet <AdaptiveConnection> .Enumerator ListEnum = AdaptiveConnections.GetEnumerator();
        while (ListEnum.MoveNext())
        {
            AdaptiveConnection Current = ListEnum.Current;

            GL.Color(Current.ArmyColor);
            GL.Vertex(Current.Marker.position);
            GL.Vertex(Current.Army.position);
        }
        ListEnum.Dispose();

        GL.End();
        GL.PopMatrix();
    }
示例#26
0
    public void DrawGUI()
    {
        if (!RenderEnabled || AdaptiveCustoms.Count <= 0)
        {
            return;
        }

        if (PreviewTex.IsPreview)
        {
            return;
        }

        Camera MainCam = CameraControler.Current.Cam;
        Rect   CamRect = MainCam.pixelRect;
        Rect   UiRect  = new Rect(CamRect.x, CamRect.y + (Screen.height - CamRect.height), CamRect.width, CamRect.height);

        GUI.BeginScrollView(UiRect, Vector2.zero, new Rect(0, (Screen.height - CamRect.height), CamRect.width, CamRect.height), false, false);

        //GUI.Label(new Rect(500, 500, 100, 50), "Test");

        Color LastColor = GUI.contentColor;

        GUI.contentColor = LabelColor;
        HashSet <AdaptiveCustom> .Enumerator ListEnum = AdaptiveCustoms.GetEnumerator();
        while (ListEnum.MoveNext())
        {
            AdaptiveCustom Current = ListEnum.Current;

            DrawGuiLabel(MainCam, CamRect, Current.Marker, Current.Text);
        }
        ListEnum.Dispose();
        GUI.contentColor = LastColor;

        GUI.EndScrollView();
    }
 private void GetHeroRcmdSymbolList()
 {
     if (!this.m_cfgHeroRcmdSymbolList.TryGetValue(this.m_curHeroId, out this.m_rcmdSymbolList))
     {
         ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(this.m_curHeroId);
         if (dataByKey == null)
         {
             DebugHelper.Assert(false, "GetHeroRcmdSymbolList heroCfgInfo is null heroId = " + this.m_curHeroId);
         }
         else
         {
             List <uint>[] listArray = new List <uint> [CSymbolInfo.s_maxSymbolLevel];
             HashSet <object> .Enumerator enumerator = GameDataMgr.symbolRcmdDatabin.GetDataByKey(dataByKey.dwSymbolRcmdID).GetEnumerator();
             while (enumerator.MoveNext())
             {
                 ResSymbolRcmd current = (ResSymbolRcmd)enumerator.Current;
                 if (listArray[current.wSymbolLvl - 1] == null)
                 {
                     listArray[current.wSymbolLvl - 1] = new List <uint>();
                 }
                 for (int i = 0; i < current.SymbolID.Length; i++)
                 {
                     if (current.SymbolID[i] > 0)
                     {
                         listArray[current.wSymbolLvl - 1].Add(current.SymbolID[i]);
                     }
                 }
             }
             this.m_cfgHeroRcmdSymbolList.Add(this.m_curHeroId, listArray);
             this.m_rcmdSymbolList = listArray;
         }
     }
 }
示例#28
0
        public override bool Equals(object other)
        {
            ;
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }
            if (!(other is Thing1SetObject))
            {
                return(false);
            }
            Thing1SetObject that = (Thing1SetObject)other;

            if (this.GetHashCode() != that.GetHashCode())
            {
                return(false);
            }
            // ThingSetValue (required)
            if (this.ThingSetValue == null && that.ThingSetValue != null)
            {
                return(false);
            }
            if (that.ThingSetValue != null && this.ThingSetValue == null)
            {
                return(false);
            }
            if (this.ThingSetValue != null && that.ThingSetValue != null)
            {
                if (this.ThingSetValue.Count != that.ThingSetValue.Count)
                {
                    return(false);
                }
                HashSet <Thing1> .Enumerator enumerator_lAtTzjsSFKIc = this.ThingSetValue.GetEnumerator();
                HashSet <Thing1> .Enumerator enumerator_jnEPIlQ6H4Zd = that.ThingSetValue.GetEnumerator();
                while (true)
                {
                    if (!enumerator_lAtTzjsSFKIc.MoveNext())
                    {
                        break;
                    }
                    enumerator_jnEPIlQ6H4Zd.MoveNext();
                    if (!(enumerator_lAtTzjsSFKIc.Current == null && enumerator_jnEPIlQ6H4Zd.Current == null))
                    {
                        if (enumerator_lAtTzjsSFKIc.Current == null && enumerator_jnEPIlQ6H4Zd.Current != null)
                        {
                            return(false);
                        }
                        if (enumerator_jnEPIlQ6H4Zd.Current != null && enumerator_lAtTzjsSFKIc.Current == null)
                        {
                            return(false);
                        }
                        if (!enumerator_lAtTzjsSFKIc.Current.Equals(enumerator_jnEPIlQ6H4Zd.Current))
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }
        private void loadDataResultTable()
        {
            if (campusHashSet != null)
            {
                HashSet <Campus> .Enumerator e = campusHashSet.GetEnumerator();

                while (e.MoveNext())
                {
                    campusList.Add(e.Current);
                }
            }

            if (lectureHashSet != null)
            {
                HashSet <Lecturer> .Enumerator l = lectureHashSet.GetEnumerator();

                while (l.MoveNext())
                {
                    lecturerList.Add(l.Current);
                }
            }

            ResultTableSource rts = new ResultTableSource(this);

            rts.campusList   = campusList;
            rts.lecturerList = lecturerList;

            searchResultTable.Source = rts;

            searchResultTable.ReloadData();
            // Perform any additional setup after loading the view, typically from a nib.
        }
示例#30
0
        public override IEnumerable <IncidentTargetTagDef> IncidentTargetTags()
        {
            using (IEnumerator <IncidentTargetTagDef> enumerator = base.IncidentTargetTags().GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    IncidentTargetTagDef type2 = enumerator.Current;
                    yield return(type2);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            if (hibernatableIncidentTargets != null && hibernatableIncidentTargets.Count > 0)
            {
                using (HashSet <IncidentTargetTagDef> .Enumerator enumerator2 = hibernatableIncidentTargets.GetEnumerator())
                {
                    if (enumerator2.MoveNext())
                    {
                        IncidentTargetTagDef type = enumerator2.Current;
                        yield return(type);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                }
            }
            yield break;
IL_016b:
            /*Error near IL_016c: Unexpected return in MoveNext()*/;
        }
示例#31
0
        public void ForEach_Int32()
        {
            var enumerator = new HashSet<int>(Enumerable.Range(0, Iterations)).GetEnumerator();

            var stopwatch = Stopwatch.StartNew();
            while (enumerator.MoveNext()) { }
            stopwatch.StopAndLog(Iterations);
        }
示例#32
0
        public void ForEach_String()
        {
            var enumerator = new HashSet<string>(Enumerable.Range(0, Iterations).Select(x => x.ToString())).GetEnumerator();

            var stopwatch = Stopwatch.StartNew();
            while (enumerator.MoveNext()) { }
            stopwatch.StopAndLog(Iterations);
        }