public void init(CellType _cellType,BombType _cellBombType,CellColor _cellColor) { string spritePath = _cellType.ToString() +_cellBombType.ToString()+ _cellColor.ToString(); Sprite newSprite = Resources.Load("Sprite/Cells/"+spritePath,typeof(Sprite)) as Sprite; GetComponent<SpriteRenderer>().sprite = newSprite; }
internal static ActiveExcelCellType TransformCellType(this CellType cellType) { cellType.ThrowIfEnumValueIsUndefined(nameof(cellType)); // TODO: determine NPOI DateTime value in cell. return(cellType switch { CellType.Unknown => ActiveExcelCellType.Unknown, CellType.Blank => ActiveExcelCellType.Unknown, CellType.String => ActiveExcelCellType.String, CellType.Numeric => ActiveExcelCellType.Numeric, CellType.Boolean => ActiveExcelCellType.Boolean, CellType.Error => ActiveExcelCellType.Error, CellType.Formula => ActiveExcelCellType.Formula, _ => throw new ArgumentOutOfRangeException( nameof(cellType), cellType, $"Unknown NPOI cell type: '{cellType.ToString()}'." ) });
/// <summary> /// Adds a cell to the current row in the current worksheet. /// </summary> /// <param name="type">A CellType enumeration. The values can be String and Number.</param> /// <param name="style">A string with a style that will be applied to the new cell.</param> /// <param name="value">A string with the contents for the cell.</param> /// <param name="mergeAcrossCells"></param> /// <remarks>The style string must exist in the styles collection of the xml document. Custom styles /// can be added by using the AddStringStyle method. A style only needs to be added once. When a style /// has been added it can be used repeatedly for both rows and cells. /// If the received style does not exist Excel will not be able to open the document. /// See the AddStringStyle method for details.</remarks> public void AddCell(CellType type, string style, string value, int mergeAcrossCells) { var row = _Workbook.Elements().Where(w => w.Name == _MainNamespace + "Worksheet").LastOrDefault() .Elements().Where(t => t.Name == _MainNamespace + "Table").LastOrDefault() .Elements().Where(r => r.Name == _MainNamespace + "Row").LastOrDefault(); XElement cell; cell = new XElement(_MainNamespace + "Cell", new XElement(_MainNamespace + "Data", new XAttribute(_ss + "Type", type.ToString()), value) ); if (mergeAcrossCells != 0) { XAttribute mergeAttribute = new XAttribute(_ss + "MergeAcross", mergeAcrossCells); cell.Add(mergeAttribute); } if (!string.IsNullOrEmpty(style)) { XAttribute styleAttribute = new XAttribute(_ss + "StyleID", style); cell.Add(styleAttribute); } row.Add(cell); ExcelFileXml = _XExport.ToString(); }
public override string ToString() { var format = string.Format("{0} p{1} c({2},{3})", CellType.ToString().Substring(0, 3), Field.GetPirates(this).Count, position.Column, position.Row); return(Discoverd ? format : "?"); }
/// <summary> /// Cell type to be created for a column. /// </summary> /// <param name="cellType"></param> /// <returns></returns> public DataTableColumnBuilder CellType(CellType cellType) { //this.Column.CellType = cellType; //ref:https://datatables.net/reference/option/columns.cellType#Default _jObject.Add("cellType", new JValue(cellType.ToString())); return(this); }
private bool ChangePick(int row, int col) { bool res = curr.ToString()[0] == Map[row, col].ToString()[0] && Map[row, col].ToString()[0] == prev.ToString()[0]; if (res) { ResetPick(); } return(res); }
private StructureModel CreateNewStructureModel(Vector3Int pos, GameObject structurePrefab, CellType type) { GameObject structure = new GameObject(type.ToString()); // create new gameobject named type structure.transform.SetParent(transform); structure.transform.localPosition = pos; var structureModel = structure.AddComponent <StructureModel>(); // add Structure model script to it structureModel.CreateModel(structurePrefab); // create the structure prefab return(structureModel); }
private Image CreateImage(CellType cellType) { return(new Image { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, Stretch = Stretch.Fill, Source = Resources[cellType.ToString()] as BitmapImage, Tag = cellType }); }
private StructureModel CreateANewStructureModel(Vector3Int position, GameObject structurePrefab, CellType type, int buildingPrefabIndex) { GameObject structure = new GameObject(type.ToString()); structure.transform.SetParent(transform); structure.transform.localPosition = position; var structureModel = structure.AddComponent <StructureModel>(); structureModel.CreateModel(structurePrefab, buildingPrefabIndex, type); return(structureModel); }
static public void SetCellShare(CellType type, int share) { if (cellShares.ContainsKey(type)) { cellShares[type] = share; cacheCellShareSum = cellShares.Sum(x => x.Value); } else { Debug.LogError("There is no key equals" + type.ToString() + " in share dictionary"); } }
private StructureModel CreateANewStructureModel(Vector3Int position, GameObject structurePrefab, CellType type) { GameObject structure = new GameObject(type.ToString()); structure.transform.SetParent(transform); Debug.Log("structure: " + structure.name); structure.transform.localPosition = position; var structureModel = structure.AddComponent <StructureModel>(); Debug.Log("structure x: " + structure.transform.position.x); structureModel.CreateModel(structurePrefab); return(structureModel); }
//放置特殊道具到场中 public void SetToolPos(Vector3 pos) { //GameDataManager.Instance.gridArr[rowIndex, colIndex].Status.ToString() + GameDataManager.Instance.gridArr[rowIndex, colIndex].Type.ToString() CellType ct = (CellType)GameDataManager.Instance.gameData.CoinType; if (!AddCell.hasTool) { toolObj = PoolManager.Instance.Get("Full" + ct.ToString()) as GameObject; } toolObj.transform.SetParent(CellBox.transform); toolObj.transform.localPosition = pos; toolObj.GetIsNullComponent <BoxCollider2D>(); toolObj.GetIsNullComponent <Bomb>(); }
private char GetCellChar(CellType c) { switch (c) { case CellType.WALL: return(Playfield.WALL); case CellType.EMPTY: return(Playfield.EMPTY); case CellType.SHELTER: return(Playfield.EMPTY); default: throw new ArgumentException(c.ToString()); } }
private void GUI_DrawCell_Name(CellType cellType) { // start of vertical center GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); // draw name of cell GUILayout.Label(cellType.ToString()); Rect labelRect = GUILayoutUtility.GetLastRect(); labelRect.height = cellButtonSize; // height of labelRect as cell size ProcessPresetEventClick(labelRect, cellType); // end of vertical center GUILayout.FlexibleSpace(); GUILayout.EndVertical(); }
private void CreateCell(Vector2 origin, CellType type, int x, int y, GameObject Organism) { if (type == CellType.None) { return; } GameObject cell = pl.Load(type.ToString(), "cells"); if (cell == null) { return; } Vector2 pos = new Vector2(x - origin.x, y - origin.y); GameObject go = Instantiate(cell, pos, Quaternion.identity, Organism.transform) as GameObject; go.GetComponent <Cell_script>().SetDNA(DNA.PerfectDuplicate()); }
/// <summary> /// 칼럼의 변수 타입명 /// </summary> /// <returns></returns> public string TypeName() { string _typeName; if (type == CellType.Enum) { _typeName = 'e' + name; } else { _typeName = type.ToString().ToLower(); } if (arrayGroup > 0) { _typeName = _typeName + "[]"; } return(_typeName); }
public GraphQuantityOverTimeFilterSettings GetGraphSettings() { switch (CellType) { case DashboardCellType.ProductionGraph: return(new GraphQuantityOverTimeFilterSettings() { IncludeAdjustements = _productionOptionsCtrl.IncludeAdjustments, IncludeCompleteProcs = _productionOptionsCtrl.IncludeCompletedProcs, IncludeWriteoffs = _productionOptionsCtrl.IncludeWriteoffs, CurGrouping = this.CurGrouping, }); case DashboardCellType.IncomeGraph: return(new GraphQuantityOverTimeFilterSettings() { IncludePaySplits = _incomeOptionsCtrl.IncludePaySplits, IncludeInsuranceClaims = _incomeOptionsCtrl.IncludeInsuranceClaimPayments, CurGrouping = this.CurGrouping, }); case DashboardCellType.BrokenApptGraph: return(new GraphQuantityOverTimeFilterSettings() { CurGrouping = this.CurGrouping, CurRunFor = _brokenApptsCtrl.CurRunFor, AdjTypeDefNum = _brokenApptsCtrl.AdjTypeDefNumCur, BrokenApptProcCode = _brokenApptsCtrl.BrokenApptCodeCur, }); case DashboardCellType.NewPatientsGraph: return(new GraphQuantityOverTimeFilterSettings() { CurGrouping = this.CurGrouping, }); case DashboardCellType.AccountsReceivableGraph: //No custom filtering so do nothing. return(new GraphQuantityOverTimeFilterSettings()); case DashboardCellType.HQMtMessage: return(new GraphQuantityOverTimeFilterSettings() { HQGrouping = _hqMsgRealTimeCtrl.CurHQGroup, }); case DashboardCellType.HQBillingUsageAccess: case DashboardCellType.HQPhone: case DashboardCellType.HQConfirmation: return(new GraphQuantityOverTimeFilterSettings() { HQConfirmationGraphType = this.HQConfirmationGraphType, }); case DashboardCellType.HQMoMessage: case DashboardCellType.HQSignups: case DashboardCellType.HQBillingInboundOutbound: //No custom filtering so do nothing. return(new GraphQuantityOverTimeFilterSettings()); default: throw new Exception("Unsupported CellType: " + CellType.ToString()); } }
internal Size MeasureCell(MapGraphics g, int fontSizeReducedBy, Font legendAutoFont, Size singleWCharacterSize) { if (cachedCellSizeFontReducedBy == fontSizeReducedBy && !cachedCellSize.IsEmpty) { return(cachedCellSize); } Size result = Size.Empty; bool disposeFont = false; Font cellFont = GetCellFont(legendAutoFont, fontSizeReducedBy, out disposeFont); if (CellType == LegendCellType.Symbol) { result.Width = (int)((float)(Math.Abs(SymbolSize.Width) * singleWCharacterSize.Width) / 100f); result.Height = (int)((float)(Math.Abs(SymbolSize.Height) * singleWCharacterSize.Height) / 100f); result.Width = (int)Math.Round((double)result.Width * 1.1); result.Height = (int)Math.Round((double)result.Height * 1.25); } else if (CellType == LegendCellType.Image) { if (ImageSize.IsEmpty && !string.IsNullOrEmpty(Image)) { Image image = GetLegend().Common.ImageLoader.LoadImage(Image); result.Width = image.Width; result.Height = image.Height; } else { result.Width = (int)((float)(Math.Abs(ImageSize.Width) * singleWCharacterSize.Width) / 100f); result.Height = (int)((float)(Math.Abs(ImageSize.Height) * singleWCharacterSize.Height) / 100f); } } else { if (CellType != 0) { throw new InvalidOperationException("Unknown Legend Cell Type: " + CellType.ToString(CultureInfo.CurrentCulture)); } string cellText = GetCellText(); result = g.MeasureStringAbs(cellText + "I", cellFont); } result.Width += (int)((float)((Margins.Left + Margins.Right) * singleWCharacterSize.Width) / 100f); result.Height += (int)((float)((Margins.Top + Margins.Bottom) * singleWCharacterSize.Height) / 100f); if (GetLegend() != null && legendItem != null && legendItem.Separator != 0) { result.Height += GetLegend().GetSeparatorSize(g, legendItem.Separator).Height; } if (disposeFont) { cellFont.Dispose(); cellFont = null; } cachedCellSize = result; cachedCellSizeFontReducedBy = fontSizeReducedBy; return(result); }
private List <GraphQuantityOverTime.GraphPointBase> OnGraphGetRawData() { List <GraphQuantityOverTime.GraphPointBase> rawData = new List <GraphQuantityOverTime.GraphPointBase>(); //Fill the dataset that we will send to the graph. The dataset will be filled according to user preferences. switch (CellType) { case DashboardCellType.ProductionGraph: { SetGroupItems(CurGrouping); if (_productionOptionsCtrl.IncludeAdjustments) { rawData.AddRange(DashboardCache.Adjustments.Cache.Select(x => GetDataPointForGrouping(x, CurGrouping))); } if (_productionOptionsCtrl.IncludeCompletedProcs) { rawData.AddRange(DashboardCache.CompletedProcs.Cache.Select(x => GetDataPointForGrouping(x, CurGrouping))); rawData.AddRange(DashboardCache.Writeoffs.Cache.Where(x => x.IsCap == true).Select(x => GetDataPointForGrouping(x, CurGrouping))); } if (_productionOptionsCtrl.IncludeWriteoffs) { rawData.AddRange(DashboardCache.Writeoffs.Cache.Where(x => x.IsCap == false).Select(x => GetDataPointForGrouping(x, CurGrouping))); } } break; case DashboardCellType.IncomeGraph: { SetGroupItems(CurGrouping); if (_incomeOptionsCtrl.IncludePaySplits) { rawData.AddRange(DashboardCache.PaySplits.Cache.Select(x => GetDataPointForGrouping(x, CurGrouping))); } if (_incomeOptionsCtrl.IncludeInsuranceClaimPayments) { rawData.AddRange(DashboardCache.ClaimPayments.Cache.Select(x => GetDataPointForGrouping(x, CurGrouping))); } } break; case DashboardCellType.AccountsReceivableGraph: { rawData.AddRange(DashboardCache.AR.Cache .Select(x => new GraphQuantityOverTime.GraphPointBase() { Val = x.BalTotal, Count = 0, SeriesName = "All", DateStamp = x.DateCalc, }) .ToList()); } break; case DashboardCellType.NewPatientsGraph: { SetGroupItems(CurGrouping); rawData.AddRange(DashboardCache.Patients.Cache.Select(x => GetDataPointForGrouping(x, CurGrouping))); } break; case DashboardCellType.BrokenApptGraph: { SetGroupItems(CurGrouping); switch (_brokenApptsCtrl.CurRunFor) { case BrokenApptGraphOptionsCtrl.RunFor.appointment: //money is not used when counting appointments graph.RemoveQuantityType(QuantityType.money); //use the broken appointment cache to get all relevant broken appts. rawData.AddRange(DashboardCache.BrokenAppts.Cache.Select(x => GetDataPointForGrouping(x, CurGrouping))); break; case BrokenApptGraphOptionsCtrl.RunFor.adjustment: //money should be added back in case the user looked at appointments beforehand. graph.InsertQuantityType(QuantityType.money, "Fees", 0); //use the broken adjustment cache to get all broken adjustments filtered by the selected adjType. rawData.AddRange(DashboardCache.BrokenAdjs.Cache.Where(x => x.AdjType == _brokenApptsCtrl.AdjTypeDefNumCur).Select(x => GetDataPointForGrouping(x, CurGrouping))); break; case BrokenApptGraphOptionsCtrl.RunFor.procedure: graph.InsertQuantityType(QuantityType.money, "Fees", 0); //use the broken proc cache to get all relevant broken procedures. List <string> listProcCodes = new List <string>(); switch (_brokenApptsCtrl.BrokenApptCodeCur) { case BrokenApptProcedure.None: case BrokenApptProcedure.Missed: listProcCodes.Add("D9986"); break; case BrokenApptProcedure.Cancelled: listProcCodes.Add("D9987"); break; case BrokenApptProcedure.Both: listProcCodes.Add("D9986"); listProcCodes.Add("D9987"); break; } rawData.AddRange(DashboardCache.BrokenProcs.Cache.Where(x => listProcCodes.Contains(x.ProcCode)).Select(x => GetDataPointForGrouping(x, CurGrouping))); break; default: throw new Exception("Unsupported CurRunFor: " + _brokenApptsCtrl.CurRunFor.ToString()); } } break; case DashboardCellType.HQMtMessage: case DashboardCellType.HQBillingUsageAccess: case DashboardCellType.HQPhone: case DashboardCellType.HQSignups: case DashboardCellType.HQConfirmation: case DashboardCellType.HQMoMessage: case DashboardCellType.HQBillingInboundOutbound: if (_onGetODGraphPointsArgs == null) { throw new Exception("OnGetODGraphPointsArgs delegate not set for CellType: " + CellType.ToString()); } rawData = _onGetODGraphPointsArgs(this); break; default: throw new Exception("Unsupported CellType: " + CellType.ToString()); } return(rawData ?? new List <GraphQuantityOverTime.GraphPointBase>()); }
internal void Paint(MapGraphics chartGraph, int fontSizeReducedBy, Font legendAutoFont, Size singleWCharacterSize) { if (cellPosition.Width <= 0 || cellPosition.Height <= 0 || !GetLegend().Common.ProcessModePaint) { return; } Color cellBackColor = GetCellBackColor(); if (!cellBackColor.IsEmpty) { chartGraph.FillRectangleRel(chartGraph.GetRelativeRectangle(cellPositionWithMargins), cellBackColor, MapHatchStyle.None, string.Empty, MapImageWrapMode.Tile, Color.Empty, MapImageAlign.Center, GradientType.None, Color.Empty, Color.Empty, 0, MapDashStyle.None, Color.Empty, 0, PenAlignment.Inset); } if (GetLegend().Common.ProcessModePaint) { switch (CellType) { case LegendCellType.Text: PaintCellText(chartGraph, fontSizeReducedBy, legendAutoFont, singleWCharacterSize); break; case LegendCellType.Image: PaintCellImage(chartGraph, fontSizeReducedBy, legendAutoFont, singleWCharacterSize); break; case LegendCellType.Symbol: PaintCellSeriesSymbol(chartGraph, fontSizeReducedBy, legendAutoFont, singleWCharacterSize); break; default: throw new InvalidOperationException("Unknown legend cell type: '" + CellType.ToString(CultureInfo.CurrentCulture) + "'."); } } }
public override string ToString() { return(position.X + " " + position.Y + " " + myType.ToString()); }
internal void Paint(ChartGraphics chartGraph, int fontSizeReducedBy, Font legendAutoFont, Size singleWCharacterSize, PointF animationLocationAdjustment) { if (cellPosition.Width <= 0 || cellPosition.Height <= 0) { return; } if (GetLegend().Common.ProcessModePaint) { Color cellBackColor = GetCellBackColor(); RectangleF relativeRectangle = chartGraph.GetRelativeRectangle(cellPositionWithMargins); if (!cellBackColor.IsEmpty) { chartGraph.FillRectangleRel(relativeRectangle, cellBackColor, ChartHatchStyle.None, string.Empty, ChartImageWrapMode.Tile, Color.Empty, ChartImageAlign.Center, GradientType.None, Color.Empty, Color.Empty, 0, ChartDashStyle.NotSet, Color.Empty, 0, PenAlignment.Inset); } GetLegend().Common.EventsManager.OnBackPaint(this, new ChartPaintEventArgs(chartGraph, GetLegend().Common, new ElementPosition(relativeRectangle.X, relativeRectangle.Y, relativeRectangle.Width, relativeRectangle.Height))); switch (CellType) { case LegendCellType.Text: PaintCellText(chartGraph, fontSizeReducedBy, legendAutoFont, singleWCharacterSize, animationLocationAdjustment); break; case LegendCellType.Image: PaintCellImage(chartGraph, fontSizeReducedBy, legendAutoFont, singleWCharacterSize, animationLocationAdjustment); break; case LegendCellType.SeriesSymbol: PaintCellSeriesSymbol(chartGraph, fontSizeReducedBy, legendAutoFont, singleWCharacterSize, animationLocationAdjustment); break; default: throw new InvalidOperationException(SR.ExceptionLegendCellTypeUnknown(CellType.ToString())); } GetLegend().Common.EventsManager.OnPaint(this, new ChartPaintEventArgs(chartGraph, GetLegend().Common, new ElementPosition(relativeRectangle.X, relativeRectangle.Y, relativeRectangle.Width, relativeRectangle.Height))); } if (GetLegend().Common.ProcessModeRegions) { GetLegend().Common.HotRegionsList.AddHotRegion(chartGraph, chartGraph.GetRelativeRectangle(cellPositionWithMargins), GetCellToolTip(), GetCellHref(), GetCellMapAreaAttributes(), legendItem, this, ChartElementType.LegendItem, legendItem.SeriesName); } }
internal Size MeasureCell(ChartGraphics graph, int fontSizeReducedBy, Font legendAutoFont, Size singleWCharacterSize) { if (cachedCellSizeFontReducedBy == fontSizeReducedBy && !cachedCellSize.IsEmpty) { return(cachedCellSize); } Size result = Size.Empty; bool disposeFont = false; Font cellFont = GetCellFont(legendAutoFont, fontSizeReducedBy, out disposeFont); if (CellType == LegendCellType.SeriesSymbol) { result.Width = (int)((float)(Math.Abs(SeriesSymbolSize.Width) * singleWCharacterSize.Width) / 100f); result.Height = (int)((float)(Math.Abs(SeriesSymbolSize.Height) * singleWCharacterSize.Height) / 100f); } else if (CellType == LegendCellType.Image) { if (ImageSize.IsEmpty && Image.Length > 0) { SizeF size = default(SizeF); if (GetLegend().Common.ImageLoader.GetAdjustedImageSize(Image, graph.Graphics, ref size)) { result.Width = (int)size.Width; result.Height = (int)size.Height; } } else { result.Width = (int)((float)(Math.Abs(ImageSize.Width) * singleWCharacterSize.Width) / 100f); result.Height = (int)((float)(Math.Abs(ImageSize.Height) * singleWCharacterSize.Height) / 100f); } } else { if (CellType != 0) { throw new InvalidOperationException(SR.ExceptionLegendCellTypeUnknown(CellType.ToString())); } string cellText = GetCellText(); result = graph.MeasureStringAbs(cellText + "I", cellFont); } result.Width += (int)((float)((Margins.Left + Margins.Right) * singleWCharacterSize.Width) / 100f); result.Height += (int)((float)((Margins.Top + Margins.Bottom) * singleWCharacterSize.Height) / 100f); if (GetLegend() != null && legendItem != null && legendItem.Separator != 0) { result.Height += GetLegend().GetSeparatorSize(graph, legendItem.Separator).Height; } if (disposeFont) { cellFont.Dispose(); cellFont = null; } cachedCellSize = result; cachedCellSizeFontReducedBy = fontSizeReducedBy; return(result); }
public string Stringify() { return(string.Format("{0},{1}-{2}{3}", _Position.X, _Position.Y, _Pop, _Type.ToString()[0])); }
public override string ToString() { return(CellType.ToString()); }
public void SetType(CellType t) { typeCell = t; img.sprite = PuzzleGame.instance.sprites.Find(o => o.name.Equals(t.ToString())); }
public override string ToString() { return(string.Format("Type: {0}\nCompletion Time: {1}\n{2}", Type.ToString(), (int)CompletionTime, IsSucceeded ? "Success!" : "Failed!")); }
protected object UnityConvertFrom(ICell cell, Type t, CellType mycell, bool myiArr) { object value = null; Debug.Log("mycell:" + mycell.ToString() + ",num:" + mycell + ",isArr:" + myiArr); if (myiArr == false) { switch (mycell) { case CellType.Undefined: var nc = new NullableConverter(t); Debug.Log("CT:nc"); return(nc.ConvertFrom(value)); case CellType.String: Debug.Log("CT:Str"); if (cell == null) { Debug.Log("CT:Str-cell is null"); value = ""; } else { if (cell.CellType == NPOI.SS.UserModel.CellType.Blank) { Debug.Log("NPOI.SS.UserModel.CellType.Blank:Str-cell is null"); value = ""; } else { if (cell.CellType == NPOI.SS.UserModel.CellType.String) { if (cell.StringCellValue != null) { Debug.Log("cell.StringCellV:" + cell.StringCellValue); value = cell.StringCellValue; } else { Debug.Log("NPOI.SS.UserModel.CellType.String:Str-cell is null"); value = ""; } } } } t = typeof(string); break; case CellType.Short: Debug.Log("CT:short"); if (cell == null) { value = (Int16)(0); } else { value = Convert.ToInt16(cell.StringCellValue); } t = typeof(short); break; case CellType.Int: Debug.Log("CT:Int"); if (cell == null) { value = (Int32)(0); } else { if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { value = cell.NumericCellValue; } else if (cell.CellType == NPOI.SS.UserModel.CellType.String) { value = Convert.ToInt32(cell.StringCellValue); } else if (cell.CellType == NPOI.SS.UserModel.CellType.Blank) { value = (Int32)(0); } Debug.Log("intValue:" + value); } t = typeof(int); break; case CellType.Long: Debug.Log("CT:Long"); if (cell == null) { value = (Int64)(0); } else { if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { value = cell.NumericCellValue; } else if (cell.CellType == NPOI.SS.UserModel.CellType.String) { value = Convert.ToInt64(cell.StringCellValue); } else if (cell.CellType == NPOI.SS.UserModel.CellType.Blank) { value = (Int64)(0); } } t = typeof(long); break; case CellType.Float: Debug.Log("CT:Float"); if (cell == null) { value = (float)(0f); } else { if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { value = cell.NumericCellValue; } else if (cell.CellType == NPOI.SS.UserModel.CellType.String) { value = Convert.ToSingle(cell.StringCellValue); } else if (cell.CellType == NPOI.SS.UserModel.CellType.Blank) { value = (float)(0f); } } t = typeof(float); break; case CellType.Double: Debug.Log("CT:Double"); if (cell == null) { value = (double)(0.0); } else { if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { value = cell.NumericCellValue; } else if (cell.CellType == NPOI.SS.UserModel.CellType.String) { value = Convert.ToDouble(cell.StringCellValue); } else if (cell.CellType == NPOI.SS.UserModel.CellType.Blank) { value = (double)(0.0); } } Debug.Log("doubleValue:" + value); t = typeof(double); break; case CellType.Enum: Debug.Log("CT:Enum"); if (cell == null) { value = (0); } else { if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { value = cell.NumericCellValue; } else if (cell.CellType == NPOI.SS.UserModel.CellType.String) { value = Convert.ToDouble(cell.StringCellValue); } else if (cell.CellType == NPOI.SS.UserModel.CellType.Blank) { value = 0; } } return(Enum.Parse(t, value.ToString(), true)); case CellType.Bool: Debug.Log("CT:Bool"); if (cell == null) { value = false; } else { value = TestBool(cell, t); } t = typeof(bool); break; } } else { // string tempCell = cell.StringCellValue; switch (mycell) { case CellType.Bool: Debug.Log("CT:Bool[]"); List <bool> tempListB = new List <bool>(); foreach (var i in ConvertExt.Split(cell.StringCellValue)) { tempListB.Add(TestBool((string)i, t)); } value = tempListB; t = typeof(List <bool>); break; case CellType.Short: Debug.Log("CT:Short[]"); List <short> tempListS = new List <short>(); if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { tempListS.Add(Convert.ToInt16(cell.NumericCellValue)); } else { List <short> addRS = ConvertExt.ToInt16Array(cell.StringCellValue).ToList <short>(); tempListS.AddRange(addRS); } value = tempListS; t = typeof(List <short>); break; case CellType.Long: Debug.Log("CT:Long[]"); List <long> tempListL = new List <long>(); if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { tempListL.Add(Convert.ToInt64(cell.NumericCellValue)); } else { List <long> addRL = ConvertExt.ToInt64Array(cell.StringCellValue).ToList <long>(); tempListL.AddRange(addRL); } value = tempListL; t = typeof(List <long>); break; case CellType.Float: Debug.Log("CT:Float[]"); List <float> tempListF = new List <float>(); if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { tempListF.Add(Convert.ToSingle(cell.NumericCellValue)); } else { List <float> addRF = ConvertExt.ToSingleArray(cell.StringCellValue).ToList <float>(); tempListF.AddRange(addRF); } value = tempListF; t = typeof(List <float>); break; case CellType.Int: Debug.Log("CT:Int[]"); List <int> tempListI = new List <int>(); if (cell == null) { Debug.Log("intArr,cell is null,add tempListI new List<int>()"); } else { Debug.Log("intArr,cell.CellType:" + cell.CellType); if (cell.CellType == NPOI.SS.UserModel.CellType.Numeric) { Debug.Log("C1,cell.NumericCellValue:" + cell.NumericCellValue); tempListI.Add(Convert.ToInt32(cell.NumericCellValue)); Debug.Log("Fin!tempListI[0]:" + tempListI[tempListI.Count - 1]); } else if (cell.CellType == NPOI.SS.UserModel.CellType.String) { Debug.Log("C2,cell.StringCellValue:" + cell.StringCellValue); foreach (var i in ConvertExt.Split(cell.StringCellValue)) { tempListI.Add(Int32.Parse((string)i)); } Debug.Log("Fin!tempListI[0]:" + tempListI[tempListI.Count - 1]); } else if (cell.CellType == NPOI.SS.UserModel.CellType.Blank) { Debug.Log("C3,cell is blank:"); if (tempListI == null) { tempListI = new List <int>(); } Debug.Log("Fin!tempListI is empty"); } } // value = tempListI; // Type tt=typeof(List<int>); // t = tt; return(tempListI.ToArray()); // return Convert.ChangeType(value, value.GetType()); break; case CellType.String: Debug.Log("CT:String[]"); List <string> tempListSS = new List <string>(); List <string> addRSS = ConvertExt.ToStringArray(cell.StringCellValue).ToList <string>(); tempListSS.AddRange(addRSS); value = tempListSS; t = typeof(List <string>); break; } } Debug.Log("valueType:" + value.GetType().ToString() + ",tType:" + t.GetType().ToString()); return(Convert.ChangeType(value, t)); }
public void Onclick() { Debug.Log("入力するセルの種類を変更 : " + cellType.ToString()); //入力するセルの種類を変更 mapEditManager.SetInputCellType(cellType); }
public void DeserializeFromJson(string json) { try { if (string.IsNullOrEmpty(json)) { return; } switch (CellType) { case DashboardCellType.HQMoMessage: case DashboardCellType.HQSignups: case DashboardCellType.HQBillingInboundOutbound: return; } GraphQuantityOverTimeFilterSettings settings = ODGraphSettingsBase.Deserialize <GraphQuantityOverTimeFilterSettings>(json); switch (CellType) { case DashboardCellType.ProductionGraph: _productionOptionsCtrl.IncludeAdjustments = settings.IncludeAdjustements; _productionOptionsCtrl.IncludeCompletedProcs = settings.IncludeCompleteProcs; _productionOptionsCtrl.IncludeWriteoffs = settings.IncludeWriteoffs; this.CurGrouping = settings.CurGrouping; break; case DashboardCellType.IncomeGraph: _incomeOptionsCtrl.IncludePaySplits = settings.IncludePaySplits; _incomeOptionsCtrl.IncludeInsuranceClaimPayments = settings.IncludeInsuranceClaims; this.CurGrouping = settings.CurGrouping; break; case DashboardCellType.BrokenApptGraph: this.CurGrouping = settings.CurGrouping; _brokenApptsCtrl.CurRunFor = settings.CurRunFor; _brokenApptsCtrl.AdjTypeDefNumCur = settings.AdjTypeDefNum; _brokenApptsCtrl.BrokenApptCodeCur = settings.BrokenApptProcCode; break; case DashboardCellType.NewPatientsGraph: this.CurGrouping = settings.CurGrouping; break; case DashboardCellType.AccountsReceivableGraph: break; case DashboardCellType.HQMtMessage: _hqMsgRealTimeCtrl.CurHQGroup = settings.HQGrouping; return; case DashboardCellType.HQBillingUsageAccess: case DashboardCellType.HQPhone: case DashboardCellType.HQConfirmation: this.HQConfirmationGraphType = settings.HQConfirmationGraphType; break; case DashboardCellType.HQMoMessage: case DashboardCellType.HQSignups: case DashboardCellType.HQBillingInboundOutbound: return; default: throw new Exception("Unsupported CellType: " + CellType.ToString()); } } catch (Exception e) { #if DEBUG MessageBox.Show(e.Message); #else e.DoNothing(); #endif } }
/** * Draws a single tile at the specified coordinate multiplied by tile size. * * @param x - X coordinate of the tile * @param z - z coordinate of the tile * @param cellType - Type of the cell */ private void DrawTile(int x, int z, CellType cellType) { var rect = new Rect(x * TileSize, z * TileSize, TileSize, TileSize); var formattedName = cellType.ToString().Substring(0, 1); GUI.Label(rect, formattedName, styles[cellType]); }
private bool PickNextCell(int row, int col) { return(Map[row, col].ToString()[0] != prev.ToString()[0] && !MapList.Any(c => c == CellType._AVAILABLE)); }