Example #1
0
        static void Main(string[] args)
        {
            List<string> words = new List<string>(); // New string-typed list
            words.Add("melon");
            words.Add("avocado");
            words.AddRange(new[] { "banana", "plum" });
            words.Insert(0, "lemon"); // Insert at start
            words.InsertRange(0, new[] { "peach", "nashi" }); // Insert at start
            words.Remove("melon");
            words.RemoveAt(3); // Remove the 4th element
            words.RemoveRange(0, 2); // Remove first 2 elements
            words.RemoveAll(s => s.StartsWith("n"));// Remove all strings starting in 'n'
            Console.WriteLine(words[0]); // first word
            Console.WriteLine(words[words.Count - 1]); // last word
            foreach (string s in words) Console.WriteLine(s); // all words
            List<string> subset = words.GetRange(1, 2); // 2nd->3rd words
            string[] wordsArray = words.ToArray(); // Creates a new typed array
            string[] existing = new string[1000];// Copy first two elements to the end of an existing array
            words.CopyTo(0, existing, 998, 2);
            List<string> upperCastWords = words.ConvertAll(s => s.ToUpper());
            List<int> lengths = words.ConvertAll(s => s.Length);

            ArrayList al = new ArrayList();
            al.Add("hello");
            string first = (string)al[0];
            string[] strArr = (string[])al.ToArray(typeof(string));
            List<string> list = al.Cast<string>().ToList();
        }
Example #2
0
 public ExtendedStatistics(List<double> values)
     : base(values)
 {
     mad = computeMad(values.ConvertAll<double>(p => p));
     iqr = computeIQR(values.ConvertAll<double>(p => p));
     entropy = computeEntropy(values.ConvertAll<double>(p => p));
     maxIndex = computeMaxIndex(values.ConvertAll<double>(p => p));
     autocorr = computeAutocorr(values.ConvertAll<double>(p => p));
 }
Example #3
0
        /**
         * Constructor taking the outside-the-scope value and a list of integer values, to
         * make both the initial and current possible variable values. The outside-the-scope value
         * must not belong to this list, or an ArgumentException is raised.
         */
        public Domain( List< int > domain, int outsideScope )
            : this(outsideScope)
        {
            if( domain.Contains( outsideScope ) )
            throw new ArgumentException("The outside-scope number must not be in domain", "outsideScope");

              CurrentDomain = domain.ConvertAll( v => v );
              InitialDomain = domain.ConvertAll( v => v );
        }
Example #4
0
 public _3DStatistic(List<double> x, List<double> y, List<double> z)
 {
     xStat = new ExtendedStatistics(x);
     yStat = new ExtendedStatistics(y);
     zStat = new ExtendedStatistics(z);
     xy_corr = computeCorrelation(x.ConvertAll<double>(p => p), y.ConvertAll<double>(p => p));
     xz_corr = computeCorrelation(x.ConvertAll<double>(p => p), z.ConvertAll<double>(p => p));
     yz_corr = computeCorrelation(y.ConvertAll<double>(p => p), z.ConvertAll<double>(p => p));
     sma = computeSMA(x.ConvertAll<double>(p => p), y.ConvertAll<double>(p => p), z.ConvertAll<double>(p => p));
     energy = computeEnergy(x.ConvertAll<double>(p => p), y.ConvertAll<double>(p => p), z.ConvertAll<double>(p => p));
 }
    IEnumerator OutroAnimation()
    {
        yield return new WaitForSeconds(1.5f);
        List<Component> components = new List<Component>(coinSpawners[currMargin].GetComponentsInChildren(typeof(Transform)));
        List<Transform> transforms = components.ConvertAll(c => (Transform)c);

        transforms.Remove(coinSpawners[currMargin].transform);
        transforms.Sort(
            delegate (Transform t1, Transform t2)
            {
                return (t1.transform.localPosition.y.CompareTo(t2.transform.localPosition.y));
            }
        );
        for (int j = transforms.Count - 1; j > -1; j--) {
            //TODO change when changing margin scripts
            if(StatePinball.Instance.ID > 2)
            {
                transforms[j].gameObject.GetComponent<CoinLoader>().strenghtXComponent = 0;
                transforms[j].gameObject.GetComponent<CoinLoader>().strenghtYComponent = 1.5f;
            }
            transforms[j].gameObject.GetComponent<CoinLoader>().ChargeIntoCannon();
            yield return new WaitForSeconds(0.2f);
        }
        yield return new WaitForSeconds(waitTimeAfterLastCoin);
        ActivateMarginSlinding();
        //StateInitializePinball.Instance.MarginDisappear();
    }
        public ReviewListMapper(IAmazonRequest amazonRequest)
        {
            this.amazonRequest = amazonRequest;
            errors = new List<KeyValuePair<string, string>>();

            try
            {
                var reviewMapper = new ReviewMapper(amazonRequest.AccessKeyId, amazonRequest.AssociateTag, amazonRequest.SecretAccessKey, amazonRequest.CustomerId);

                reviews = reviewMapper.GetReviews();

                foreach (var error in reviewMapper.GetErrors())
                {
                    errors.Add(error);
                }

                var productMapper = new ProductMapper(amazonRequest.AccessKeyId, amazonRequest.AssociateTag, amazonRequest.SecretAccessKey);

                products = productMapper.GetProducts(reviews.ConvertAll(review => review.ASIN));

                foreach (var error in productMapper.GetErrors())
                {
                    errors.Add(error);
                }
            }
            catch(Exception ex)
            {
                errors.Add(new KeyValuePair<string, string>("ServiceError", ex.Message));
            }
        }
        /// <summary>
        /// Gets all permissions by names.
        /// Throws <see cref="AbpValidationException"/> if can not find any of the permission names.
        /// </summary>
        public static IEnumerable<Permission> GetPermissionsFromNamesByValidating(this IPermissionManager permissionManager, IEnumerable<string> permissionNames)
        {
            var permissions = new List<Permission>();
            var undefinedPermissionNames = new List<string>();

            foreach (var permissionName in permissionNames)
            {
                var permission = permissionManager.GetPermissionOrNull(permissionName);
                if (permission == null)
                {
                    undefinedPermissionNames.Add(permissionName);
                }

                permissions.Add(permission);
            }

            if (undefinedPermissionNames.Count > 0)
            {
                throw new AbpValidationException(string.Format("There are {0} undefined permission names.", undefinedPermissionNames.Count))
                      {
                          ValidationErrors = undefinedPermissionNames.ConvertAll(permissionName => new ValidationResult("Undefined permission: " + permissionName))
                      };
            }

            return permissions;
        }
Example #8
0
		protected override CompilerResults GetResultsFrom(List<SourceFile> files)
		{
			string pdbFileName = parameters.OutputAssembly.Substring(0, parameters.OutputAssembly.Length - 3) + "pdb";
			fileSystem.Delete(parameters.OutputAssembly);
			fileSystem.Delete(pdbFileName);

			if (options.KeepTemporarySourceFiles)
			{
				string[] sourceFiles = files.ConvertAll<string>(SourceFileToFileName).ToArray();

				return codeProvider.CompileAssemblyFromFile(parameters, sourceFiles);
			}
			string[] sources = files.ConvertAll<string>(SourceFileToSource).ToArray();

			return codeProvider.CompileAssemblyFromSource(parameters, sources);
		}
Example #9
0
    public static ExpressionMatrix ReadMatrix(this TCGATechnologyType ttt, TCGADataType tdt, List<BarInfo> bis, List<string> genes)
    {
      double?[,] data = new double?[genes.Count, bis.Count];
      for (int i = 0; i < bis.Count; i++)
      {
        var reader = ttt.GetTechnology().GetReader();
        var fn = tdt == TCGADataType.Count ? ttt.GetTechnology().GetCountFilename(bis[i].FileName) : bis[i].FileName;
        var dd = reader.ReadFromFile(fn).Values.ToDictionary(m => m.Name, m => m.Value);
        for (int j = 0; j < genes.Count; j++)
        {
          if (dd.ContainsKey(genes[j]))
          {
            data[j, i] = dd[genes[j]];
          }
          else
          {
            data[j, i] = null;
          }
        }
      }

      ExpressionMatrix result = new ExpressionMatrix();
      result.Values = data;
      result.Rownames = genes.ToArray();
      result.Colnames = bis.ConvertAll(m => m.BarCode).ToArray();
      return result;
    }
Example #10
0
 public IEnumerable<string> GetTemplates(string root)
 {
     var result = new List<string>();
     IntPtr ppHier;
     uint pitemid;
     IVsMultiItemSelect ppMIS;
     IntPtr ppSC;
     object directory = "";
     if (ErrorHandler.Succeeded(GlobalServices.SelectionTracker.GetCurrentSelection(out ppHier, out pitemid, out ppMIS, out ppSC)))
     {
         try
         {
             IVsHierarchy hier = (IVsHierarchy)Marshal.GetObjectForIUnknown(ppHier);
             if (ErrorHandler.Succeeded(hier.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ProjectDir, out directory)))
                 if (project_directory == (string)directory)
                 {
                     result.AddRange(Directory.EnumerateFiles(directory + root, "*.django", SearchOption.AllDirectories));
                     result.AddRange(Directory.EnumerateFiles(directory + root, "*.htm", SearchOption.AllDirectories));
                     result.AddRange(Directory.EnumerateFiles(directory + root, "*.html", SearchOption.AllDirectories));
                 }
         }
         finally
         {
             Marshal.Release(ppHier);
             if (!ppSC.Equals(IntPtr.Zero))
                 Marshal.Release(ppSC);
         }
     }
     return result.ConvertAll(file => file.Substring((directory + root).Length + 1));
 }
Example #11
0
 public void CreateFriendrequest(List<FriendBM> frndbm)
 {
     ProWorldzContext context = new ProWorldzContext();
     List<Friend> friends = frndbm.ConvertAll<Friend>(new Converter<FriendBM, Friend>(ConvertToDM));
     context.Friend.AddRange(friends);
     context.SaveChanges();
 }
 internal void UpdateDependencies(List<ShadowFileNode> dependencies)
 {
     if (dependencies.Count == 0)
         buildItem.RemoveMetadata(Constants.DependsOn);
     else
         buildItem.SetMetadata(Constants.DependsOn, dependencies.ConvertAll(elem => elem.buildItem.ToString()).Aggregate("", (a, item) => a + ',' + item).Substring(1));
 }
Example #13
0
		private void ProcessJavascript(List<LineOfJavascript> lines)
		{
			List<LineOfJavascript> nonAspRelatedLines = new List<LineOfJavascript>();
			foreach (var line in lines)
			{
				if (line.Namespace.IsAspControlNamespace)
				{
					line.Namespace.Lines.Add(line);
				}
				else if (line.Namespace.ParentAspControlNamespace != null)
				{
					line.Namespace.ParentAspControlNamespace.Lines.Add(line);
				}
				else
				{
					nonAspRelatedLines.Add(line);
				}
			}

			bool isDebug = inputFile.Name.EndsWith(".debug.js");
			foreach (var file in outputDirectory.GetFiles(isDebug ? "*.debug.js" : "*.js"))
			{
				file.Delete();
			}
			foreach (var ns in Namespace.Namespaces)
			{
				if (ns.Lines.Count > 0)
				{

					File.WriteAllLines(Path.Combine(outputDirectory.FullName, ns.Name + (isDebug ? ".debug" : "" ) + ".js"), ns.Lines.ConvertAll(l => l.Text).ToArray());
				}
			}

			File.WriteAllLines(Path.Combine(outputDirectory.FullName, inputFile.Name), nonAspRelatedLines.ConvertAll(l => l.Text).ToArray());
		}
        public ProductListMapper(IAmazonRequest amazonRequest)
        {
            this.amazonRequest = amazonRequest;
            errors = new List<KeyValuePair<string, string>>();

            try
            {
                var listMapper = new ListMapper(amazonRequest.AccessKeyId, amazonRequest.AssociateTag, amazonRequest.SecretAccessKey, amazonRequest.ListId);

                listItems = listMapper.GetList();

                foreach (var error in listMapper.GetErrors())
                {
                    errors.Add(error);
                }

                var productMapper = new ProductMapper(amazonRequest.AccessKeyId, amazonRequest.AssociateTag, amazonRequest.SecretAccessKey);

                products = productMapper.GetProducts(listItems.ConvertAll(listItem => listItem.ASIN));

                foreach (var error in productMapper.GetErrors())
                {
                    errors.Add(error);
                }
            }
            catch(Exception ex)
            {
                errors.Add(new KeyValuePair<string, string>("ServiceError", ex.Message));
            }
        }
Example #15
0
 public FormConferention(string _roomJid, string _roomName, bool _savingHistory, bool _persistRoom, string _roomDesc = "", List<string> users = null )
 {
     InitializeComponent();
     roomJid = new Jid(_roomJid);
     roomName = _roomName;
     this.Text = _roomName;
     roomDesc = _roomDesc;
     mainJid = Settings.jid;
     nickname = Settings.nickname;
     xmpp = Settings.xmpp;
     muc = new MucManager(xmpp);
     savingHistory = _savingHistory ? "1" : "0";
     persistRoom = _persistRoom ? "1" : "0";
     //muc.AcceptDefaultConfiguration(roomJid, new IqCB(OnGetFieldsResult));
     muc.CreateReservedRoom(roomJid);
     muc.GrantOwnershipPrivileges(roomJid, new Jid(mainJid));
     muc.JoinRoom(roomJid, nickname);
     initMucConfig();
     xmpp.MesagageGrabber.Add(roomJid, new BareJidComparer(), new MessageCB(MessageCallback), null);
     xmpp.PresenceGrabber.Add(roomJid, new BareJidComparer(), new PresenceCB(PresenceCallback), null);
     muc.Invite(users.ConvertAll<Jid>(
         delegate(string jid)
         {
             return new Jid(jid);
         }
     ).ToArray(), roomJid, "Вы приглашены в конференцию Конф.");
 }
Example #16
0
 public Card(string CardAsString, User _Controller)
 {
     List<string> Card = new List<string>();
     Card.AddRange(CardAsString.Replace("[", "").Replace("]", "").Split(new string[] { "," }, StringSplitOptions.None));
     NumberInDeck = Convert.ToInt32(Card[0]);
     SerialNo = Convert.ToInt32(Card[1]);
     UnitTitle = Card[2];
     UnitName = Card[3];
     Power = Convert.ToInt32(Card[4]);
     Support = Convert.ToInt32(Card[5]);
     IsHorizontal = Convert.ToBoolean(Card[6]);
     FrontShown = Convert.ToBoolean(Card[7]);
     Visible = Convert.ToBoolean(Card[8]);
     List<string> temp = new List<string>();
     if (Card[9] != "()")
     {
         temp.AddRange(Card[9].Replace("(", "").Replace(")", "").Split(new string[] { ";" }, StringSplitOptions.None));
         while (temp.Contains(""))
         {
             temp.Remove("");
         }
         OverlayCardNo = temp.ConvertAll<Int32>(Convert.ToInt32);
     }
     else
     {
         OverlayCardNo = new List<int>();
     }
     Comments = Card[10];
     Controller = _Controller;
 }
Example #17
0
 public Message(string message)
 {
     message = removeInvalid.Replace(message,"");
     List<string> lines = new List<string>(message.Split(new char[1]{'\n'},StringSplitOptions.RemoveEmptyEntries));
     for (int i=0;i<lines.Count;i++) {
         string line = lines[i];
         line = removeMultiple.Replace(line,"$+");
         line = removeEnd.Replace(line,"");
         line = removeUnused.Replace(line,"$1");
         if (line[line.Length-1]=='&') {
             line = line.Substring(0,line.Length-1);
         } if (line.Length<=64) { continue; }
         int lastspace = line.LastIndexOf(' ',63,wordwrap);
         if (lastspace!=-1) { line = line.Remove(lastspace,1); }
         int pos = (lastspace!=-1)?lastspace:64;
         int lastcolor = line.LastIndexOf('&',pos-1,pos);
         string color = "";
         if (lastcolor!=-1) {
             color = line.Substring(lastcolor,2);
         } if (lastcolor>=pos-2 && lastcolor<pos) {
             line = line.Remove(lastcolor,2);
             pos = lastcolor;
         }lines[i] = line.Substring(0,pos);
         lines.Insert(i+1,color+"-> "+line.Substring(pos));
     } packets = lines.ConvertAll(new Converter<string,Packet>(ToPacket));
 }
Example #18
0
        public ProxyType(Type type)
        {
            var envTypes = new List<Type>();
            var methods =
                (from method in type.GetMethods(BindingFlags.Instance | BindingFlags.Public)
               .Where(method => Attribute.IsDefined(method, typeof(ServiceMethodAttribute)))
                 select new
                 {
                     MethodName = method.Name,
                     ServiceAttribute = (ServiceMethodAttribute)Attribute.GetCustomAttribute(method, typeof(ServiceMethodAttribute))
                 }).ToArray();

            var mappings = (from m in methods select new
                {
                  MethodName = m.MethodName,
                  Action = m.ServiceAttribute.Action,
                  ArgsTypeIndex = AddOrGetIndexOfExistingType(envTypes, m.ServiceAttribute.ArgType),
                  ResultsTypeIndex = AddOrGetIndexOfExistingType(envTypes, m.ServiceAttribute.ReturnType)
                }).ToArray();

            var xmlRoot = new XmlRootAttribute("Command");
            var envSerializers = envTypes.ConvertAll<XmlSerializer>(t => new XmlSerializer(t, xmlRoot));
            foreach (var m in mappings)
            {
                var svcMethod = new ServiceMethodInfo()
                {
                    MethodName = m.MethodName,
                    ServiceAction = m.Action,
                    ArgsSerializer = envSerializers[m.ArgsTypeIndex],
                    ResultsSerializer = envSerializers[m.ResultsTypeIndex]
                };
                _methods.Add(svcMethod.MethodName, svcMethod);
            }
        }
        private Row GenerateRowForProperty(UInt32Value rowIndex, int linesToAdd, ProjectFile projectFile, String property)
        {
            Row row = new Row() { RowIndex = (UInt32Value)(rowIndex + linesToAdd), Spans = new ListValue<StringValue>() { InnerText = "3:9" }, DyDescent = 0.25D };
            ProjectProperty projectProperty = projectFile.ProjectProperties.FirstOrDefault(prop => prop.Type == property);
            if (projectProperty != null)
            {
                int sharedStringIndexForType = 0;

                for (int i = 0; i < SharedStrings.Count; i++)
                {
                    if (SharedStrings[i].Text.Text == projectProperty.Type)
                    {
                        sharedStringIndexForType = i;
                        break;
                    }
                }

                List<Cell> cells = new List<Cell>()
                    {
                        new Cell(){CellReference = GetCell(String.Format("C{0}", rowIndex.Value), linesToAdd),StyleIndex = (UInt32Value) 7U,DataType = CellValues.SharedString, CellValue = new CellValue(sharedStringIndexForType.ToString(CultureInfo.InvariantCulture))},
                        new Cell(){CellReference = GetCell(String.Format("D{0}", rowIndex.Value), linesToAdd),StyleIndex = (UInt32Value) 8U,DataType = CellValues.Number, CellValue = new CellValue(projectProperty.Rate.ToString(CultureInfo.InvariantCulture))},
                        new Cell(){CellReference = GetCell(String.Format("F{0}", rowIndex.Value), linesToAdd),StyleIndex = (UInt32Value) 9U,DataType = CellValues.Number, CellValue = new CellValue(projectProperty.Words.ToString(CultureInfo.InvariantCulture))},
                        new Cell(){CellReference = GetCell(String.Format("G{0}", rowIndex.Value), linesToAdd),StyleIndex = (UInt32Value) 9U,DataType = CellValues.Number, CellValue = new CellValue(projectProperty.Characters.ToString(CultureInfo.InvariantCulture))},
                        new Cell(){CellReference = GetCell(String.Format("H{0}", rowIndex.Value), linesToAdd),StyleIndex = (UInt32Value) 9U,DataType = CellValues.Number, CellValue = new CellValue(projectProperty.ValueByWords.ToString(CultureInfo.InvariantCulture))},
                        new Cell(){CellReference = GetCell(String.Format("I{0}", rowIndex.Value), linesToAdd),StyleIndex = (UInt32Value) 9U,DataType = CellValues.SharedString, CellValue = new CellValue("15")}
                    };
                row.Append(cells.ConvertAll(c => (OpenXmlElement) c));
            }
            return row;
        }
Example #20
0
    void Update()
    {
        elapsed += Time.deltaTime;
        if (elapsed > 1f)
        {
            elapsed = 0f;
            List<int> lst = new List<int>();
            lst.Add(6);
            lst.Add(95);
            foreach (var v in lst)
            {
                Debug.Log(v);
            }
            int vFind = lst.Find((val) => (val == 6));
            Debug.Log("vFind = " + vFind);

            var lstS = lst.ConvertAll<string>((v) => "s: " + v);
            foreach (var v in lstS)
            {
                Debug.Log(v);
            }
            Debug.Log(lstS[0]);
            Debug.Log(lstS[1]);
        }
	}
Example #21
0
 public override Vector3[] GetPathPositions()
 {
     nodes = DijkstraPathFinder.FindShortestPath(CurrentNode, PathBuilder.Instance.GetNodeById(positionToGo));
     List<Vector3> nodePositions = nodes.ConvertAll(item => item.transform.position);
     nodePositions.Insert(0, transform.position);
     return nodePositions.ToArray();
 }
Example #22
0
        public Polygon2D(Vector2[] mainPoints, List<CLine> lines)
        {
            this.mainPoints[0] = mainPoints[0];
            this.mainPoints[1] = mainPoints[1];

            this.lines = lines.ConvertAll(l => new Line2D(l.NPoints[0], l.NPoints[1], l.IsSeam));
        }
    protected void CreateCircle()
    {
        List<Component> components =
            new List<Component>(SplineRoot.GetComponentsInChildren(typeof(Transform)));

        List<Transform> transforms = components.ConvertAll(c => (Transform)c);

        transforms.Remove(SplineRoot.transform);
        transforms.Sort(delegate(Transform a, Transform b)
                        {
            return a.name.CompareTo(b.name);
        });

        Vector3 midpoint = Vector3.zero;
        int numberOfNodes = transforms.Count;
        if (numberOfNodes <= 1) return;
        foreach (Transform element in transforms)
        {
            midpoint += element.position;
        }

        midpoint = midpoint / numberOfNodes;

        int i = 0;
        foreach (Transform element in transforms)
        {
            element.position = new Vector3(midpoint.x + xRadius * Mathf.Cos((i * (2* Mathf.PI)) / numberOfNodes), midpoint.y, midpoint.z + yRadius * Mathf.Sin((i *2 * Mathf.PI) / numberOfNodes));
            ++i;
        }

        transforms[numberOfNodes - 1].position = transforms[0].position;
    }
	static public Mesh CreateMesh(float[,,] voxels)
	{
        
		List<Vector3> verts = new List<Vector3>();
		List<int> index = new List<int>();
		
		float[] cube = new float[8];
		
		for(int x = 0; x < voxels.GetLength(0)-1; x++)
		{
			for(int y = 0; y < voxels.GetLength(1)-1; y++)
			{
				for(int z = 0; z < voxels.GetLength(2)-1; z++)
				{
					//Get the values in the 8 neighbours which make up a cube
					FillCube(x,y,z,voxels,cube);
					//Perform algorithm
					Mode_Func(new Vector3(x,y,z), cube, verts, index);
				}
			}
		}
		
        //Center pivot point
	    verts = verts.ConvertAll(vert => vert -= new Vector3(voxels.GetLength(0)/2f, voxels.GetLength(1)/2f, voxels.GetLength(2)/2f));

		Mesh mesh = new Mesh();

		mesh.vertices = verts.ToArray();		
		mesh.triangles = index.ToArray();
		
		return mesh;
	}
Example #25
0
    //Get cleared Kuni and check current open and register the difference to open kuni
    public void registerOpenKuni(int clearedKuniId)
    {
        List<int> openKuniList = new List<int>();

        //Identify Cleared Kuni
        for(int i=0; i<kuniMapMst.param.Count; i++){
            int temClearedKuniId = kuniMapMst.param[i].Souce;
            if(temClearedKuniId == clearedKuniId){
                openKuniList.Add(kuniMapMst.param[i].Open);
            }
        }

        //Remove Existed Open Kuni
        List<string> tempList = new List<string>();
        string openKuniString = PlayerPrefs.GetString("openKuni");
        char[] delimiterChars = {','};
        tempList = new List<string>(openKuniString.Split (delimiterChars));
        List<int> openedKuniList = tempList.ConvertAll(x => int.Parse(x));

        foreach (int i in openKuniList) {

            if(!openedKuniList.Contains(i)){
                openKuniString = openKuniString + "," + i.ToString();
                string tempKuni = "naisei" + i.ToString();
                PlayerPrefs.SetString(tempKuni,"1,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0,0:0");

            }
        }

        //Open kuni initial data setting
        PlayerPrefs.SetString("openKuni", openKuniString);
        PlayerPrefs.Flush();
    }
Example #26
0
 public override BuilderOut BuildQueueAfterTTIZero(List<ISimulationUser> userList, List<ISimulationUser> newUserList, int curTTI, int residualRb)
 {
     List<IUlScheduleUser> list = new List<IUlScheduleUser>();
     List<IUlScheduleUser> nonScheduledList = new List<IUlScheduleUser>();
     List<IUlScheduleUser> list3 = newUserList.ConvertAll<IUlScheduleUser>(new Converter<ISimulationUser, IUlScheduleUser>(UlScheduleTools.ConvertToUlSchUser));
     List<IUlScheduleUser> lessThanGBRList = new List<IUlScheduleUser>();
     List<IUlScheduleUser> lessThanNonGBRList = new List<IUlScheduleUser>();
     List<IUlScheduleUser> gBRHappyList = new List<IUlScheduleUser>();
     List<IUlScheduleUser> nonGBRHappyList = new List<IUlScheduleUser>();
     foreach (IUlScheduleUser user in userList)
     {
         this.AssortUser(user, curTTI, lessThanGBRList, lessThanNonGBRList, gBRHappyList, nonGBRHappyList, nonScheduledList);
     }
     UlScheduleTools.SortUserList(nonScheduledList, base.noScheduledComparer, curTTI);
     UlScheduleTools.SortUserList(list3, base.newAccessUserComparer, curTTI);
     this.SortServicedUser(lessThanGBRList, curTTI, residualRb, new CalBr(this.CalLessThanBrUser));
     this.SortServicedUser(lessThanNonGBRList, curTTI, residualRb, new CalBr(this.CalLessThanBrUser));
     this.SortServicedUser(gBRHappyList, curTTI, residualRb, new CalBr(this.CalMoreThanBrUser));
     this.SortServicedUser(nonGBRHappyList, curTTI, residualRb, new CalBr(this.CalMoreThanBrUser));
     list.AddRange(nonScheduledList);
     list.AddRange(list3);
     list.AddRange(lessThanGBRList);
     list.AddRange(lessThanNonGBRList);
     list.AddRange(gBRHappyList);
     list.AddRange(nonGBRHappyList);
     base.m_BuilderOut.NormalUserList = list;
     base.m_BuilderOut.NoPacketUserList = new List<IUlScheduleUser>();
     return base.m_BuilderOut;
 }
Example #27
0
 // Set all the items in the list box, and check them all.
 public void SetControlsToDelete(List<KeyValuePair<Id<ControlPoint>,string>> controlsToDelete)
 {
     codeListBox.Items.Clear();
     codeListBox.Items.AddRange(controlsToDelete.ConvertAll(pair => new ListItem(pair.Key, pair.Value)).ToArray());
     for (int i = 0; i < codeListBox.Items.Count; ++i)
         codeListBox.SetItemChecked(i, true);
 }
        public void CheckForUnregisteredProperties()
        {
            //todo: build stackrace or other go to code functionality

            registeredButUntested = testedSpecs.FindAll(s => s.TimesTested == 0);
            if (registeredButUntested.Count != 0)
            {
                StringBuilder message = new StringBuilder();
                registeredButUntested.ConvertAll(s => s.Name)
                    .ForEach(s => message.AppendLine(s));
                try
                {
                    throw new UnregisteredPropertiesException(message.ToString());
                }
                catch (UnregisteredPropertiesException exception)
                {
                    try
                    {
                        throw new SpecFailedException(
                                "Registered Spec not evaluated", exception );
                    }
                    catch (SpecFailedException specFailedException)
                    {
                        failedSpec = specFailedException;
                    }
                }
            }
        }
Example #29
0
 /// <summary>
 /// Obtain list of errors, made by EnC not valid changes.
 /// </summary>
 /// <param name="changes">List of changes made in running code.</param>
 /// <returns>List of errors, empty if there are not any.</returns>
 public static List<BuildError> GetErrors(List<SourceChange> changes)
 {
     List<BuildError> errors = changes.ConvertAll(new Converter<SourceChange, BuildError>(IsValid));
     errors.RemoveAll(delegate(BuildError err){return err == null;});
     errors.TrimExcess();
     return errors;
 }
Example #30
0
        /// <summary>
        /// Add List of tags to the database that are assocated with this distance
        /// </summary>
        /// <param name="Distance">Distance of tags in cm</param>
        /// <param name="TagList">List of the tags</param>
        public void Add_Tags(int Distance, List<Tag> TagList)
        {
            List<LookupData> ConvertedData = TagList.ConvertAll(r => new LookupData(r, Distance));

            this.LookupData.InsertAllOnSubmit(ConvertedData);

            this.SubmitChanges();
        }