Example #1
0
 public void testCount()
 {
     IList<string> list = new ArrayList<string>();
     list.Add("hoi");
     list.Add("noot");
     AssertEquals(2, list.Size());
 }
		public void setItems(ArrayList items) {
			for(int i = 0;i != items.Size();i++){
				//if(items.li == 1) {
					items.Set(i, "0" + items.Get(i));
				//}
			}
			this.items = items;
		}
Example #3
0
		private Integer SetVerticalCellRange(LinkedDataRecord linkedDataRecord,
				                             CellRangeAddressBase range) {
			if (linkedDataRecord == null)
			{
				return null;
			}
			
			List<Ptg> ptgList = new ArrayList<Ptg>();
			
			int rowCount = (range.GetLastRow() - range.GetFirstRow()) + 1;
			int colCount = (range.GetLastColumn() - range.GetFirstColumn()) + 1;
			
			for (Ptg ptg : linkedDataRecord.GetFormulaOfLink()) {
				if (ptg is AreaPtgBase) {
					AreaPtgBase areaPtg = (AreaPtgBase) ptg;
					
					areaPtg.SetFirstRow(range.GetFirstRow());
					areaPtg.SetLastRow(range.GetLastRow());
					
					areaPtg.SetFirstColumn(range.GetFirstColumn());
					areaPtg.SetLastColumn(range.GetLastColumn());
					ptgList.Add(areaPtg);
				}
			}
			
			linkedDataRecord.SetFormulaOfLink(ptgList.ToArray(new Ptg[ptgList.Size()]));
			
			return rowCount * colCount;
		}
Example #4
-1
        private void loadMap()
        {
            ArrayList<string> lines = new ArrayList<string>();
            int width = 0;
            int height = 0;

            var scanner = new Scanner(SampleGame.map);
            while (scanner.HasNextLine())
            {
                string line = scanner.NextLine();

                // no more lines to read
                if (line == null)
                {
                    break;
                }

                if (!line.StartsWith("!"))
                {
                    lines.Add(line);
                    width = Math.Max(width, line.Length);

                }
            }
            height = lines.Size();

            for (int j = 0; j < 12; j++)
            {
                string line = (string) lines.Get(j);
                for (int i = 0; i < width; i++)
                {

                    if (i < line.Length)
                    {
                        char ch = line[i];
                        Tile t = new Tile(i, j, char.GetNumericValue(ch));
                        tilearray.Add(t);
                    }

                }
            }

        }