示例#1
0
 public void AddEdge(Edge <TVertex> edge, bool directed)
 {
     map.Add(edge.From, edge);
     if (!directed)
     {
         map.Add(edge.To, edge.Reverse());
     }
 }
示例#2
0
 public static void AddResourcesInDec(string key, List <NewsPreviewModel> instance)
 {
     if (!ListMap.ContainsKey(key))
     {
         ListMap.Add(key, instance);
     }
 }
示例#3
0
        private void fillTimes(Dictionary <long, string> consoleCommands)
        {
            foreach (var kv in consoleCommands)
            {
                var value = kv.Value;
                if (value.StartsWith("print"))
                {
                    //print "Date: 10-25-14 02:43\n"
                    if (value.StartsWith("print \"Date:"))
                    {
                        dateStamps.Add(value);
                    }

                    //print "Time performed by ^2uN-DeaD!Enter^7 : ^331:432^7 (v1.91.23 beta)\n"
                    if (value.StartsWith("print \"Time performed by"))
                    {
                        allTimes.Add(TimeType.OFFLINE_NORMAL, value);   //defrag 1.9+
                    }

                    //"print \"^3Time Performed: 25:912 (defrag 1.5)\n^7\""
                    if (value.StartsWith("print \"^3Time Performed:"))
                    {
                        allTimes.Add(TimeType.OFFLINE_OLD2, value);     //defrag 1.5
                    }

                    //print \"Rom^7 reached the finish line in ^23:38:208^7\n\"
                    if (value.Contains("reached the finish line in"))
                    {
                        allTimes.Add(TimeType.ONLINE_NORMAL, value);
                    }
                }
                else if (value.StartsWith("NewTime"))
                {
                    //"NewTime -971299442 7:200 \"defrag 1.80\" \"Viper\" route ya->->rg"
                    allTimes.Add(TimeType.OFFLINE_OLD1, value);     //defrag 1.80
                }
                else if (value.StartsWith("newTime"))
                {
                    //newTime 47080
                    allTimes.Add(TimeType.OFFLINE_OLD3, value);     //defrag 1.42
                }
            }
        }
示例#4
0
        /*--------------------------------------------------------------------------------------------*/
        public ProjectionState GetProjection(CursorType pCursorType)
        {
            if (!vProjectionMap.ContainsKey(pCursorType))
            {
                ICursorState state = Hovercursor.GetCursorState(pCursorType);

                var proj = new ProjectionState(state, vInteractSett, vBaseTx);
                vProjectionMap.Add(pCursorType, proj);
            }

            return(vProjectionMap[pCursorType]);
        }
示例#5
0
        private KeyValuePair <int, ClientEvent>?getCorrectFinishEvent()
        {
            var correctFinishes = new ListMap <int, ClientEvent>();

            for (int i = clientEvents.Count - 1; i >= 0; i--)
            {
                int isCorrect = isEventCorrect(clientEvents, i);
                if (isCorrect > 0)
                {
                    correctFinishes.Add(isCorrect, clientEvents[i]);
                }
            }
            if (correctFinishes.Count > 0)
            {
                return(Ext.MinOf(correctFinishes, x => x.Value.time));
            }
            else
            {
                return(null);
            }
        }