當前位置: 首頁>>代碼示例>>C#>>正文


C# CellType類代碼示例

本文整理匯總了C#中CellType的典型用法代碼示例。如果您正苦於以下問題:C# CellType類的具體用法?C# CellType怎麽用?C# CellType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CellType類屬於命名空間,在下文中一共展示了CellType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Cell

 public Cell(int newID, int newType, Vector3 loc, Vector3 size)
 {
     id = newID;
     type = (CellType)newType;
     location = loc;
     bounds = new Bounds(loc,size);
 }
開發者ID:jdohgamer,項目名稱:SSC,代碼行數:7,代碼來源:Cell.cs

示例2: MemberFieldData

        public MemberFieldData(string def)
        {
            string[] strSplit = def.Split(':');
            if (strSplit.Length > 1) {
                string typedef = strSplit[1];

                if (string.Compare(typedef, "integer") == 0)
                    type = CellType.Int;
                else if (string.Compare(typedef, "string") == 0)
                    type = CellType.String;
                else if (string.Compare(typedef, "float") == 0)
                    type = CellType.Float;
                else if (string.Compare(typedef, "double") == 0)
                    type = CellType.Double;
                else if (string.Compare(typedef, "enum") == 0)
                    type = CellType.Enum;
                else if (string.Compare(typedef, "bool") == 0)
                    type = CellType.Bool;
                else {
                    type = CellType.Undefined;
                    Debug.LogError("Wrong cell type is defined: " + typedef);
                }
            } else
                type = CellType.Undefined;

            name = strSplit[0];
        }
開發者ID:petereichinger,項目名稱:Unity-QuickSheet,代碼行數:27,代碼來源:ScriptPrescription.cs

示例3: SetValue

        public void SetValue(ValueEval value)
        {
            Type cls = value.GetType();

            if (cls == typeof(NumberEval))
            {
                _cellType = CellType.NUMERIC;
                _numberValue = ((NumberEval)value).NumberValue;
                return;
            }
            if (cls == typeof(StringEval))
            {
                _cellType = CellType.STRING;
                _stringValue = ((StringEval)value).StringValue;
                return;
            }
            if (cls == typeof(BoolEval))
            {
                _cellType = CellType.BOOLEAN;
                _boolValue = ((BoolEval)value).BooleanValue;
                return;
            }
            if (cls == typeof(ErrorEval))
            {
                _cellType = CellType.ERROR;
                _errorValue = ((ErrorEval)value).ErrorCode;
                return;
            }
            if (cls == typeof(BlankEval))
            {
                _cellType = CellType.BLANK;
                return;
            }
            throw new ArgumentException("Unexpected value class (" + cls.Name + ")");
        }
開發者ID:Johnnyfly,項目名稱:source20131023,代碼行數:35,代碼來源:ForkedEvaluationCell.cs

示例4: CreateCell

        public virtual FrameworkElement CreateCell(DataGrid grid, CellType cellType, CellRange rng)
        {
            // cell border
            var bdr = CreateCellBorder(grid, cellType, rng);

            // bottom right cells have no content
            if (!rng.IsValid)
            {
                return bdr;
            }

            // bind/customize cell by type
            switch (cellType)
            {
                case CellType.Cell:
                    CreateCellContent(grid, bdr, rng);
                    break;

                case CellType.ColumnHeader:
                    CreateColumnHeaderContent(grid, bdr, rng);
                    break;
            }

            // done
            return bdr;
        }
開發者ID:GJian,項目名稱:UWP-master,代碼行數:26,代碼來源:CellFactory.cs

示例5: sCell

    public sCell(GameObject cell)
    {
        if (cell == null)
        {
            type = CellType.Null;
            return;
        }

        pos = new sVector3(cell.transform.position);
        value = cell.GetComponent<CellValue>().Value;

        switch (cell.tag)
        {
            case "Dragon":
                type = CellType.Dragon;
                break;
            case "Hero":
                type = CellType.Hero;
                break;
            case "Monster":
                type = CellType.Monster;
                break;
            case "Sword":
                type = CellType.Sword;
                break;
        }
    }
開發者ID:jdcaruso,項目名稱:Hero48Game,代碼行數:27,代碼來源:sCell.cs

示例6: CreateCell

        public void CreateCell(CellType type, Vector3 position)
        {
            var cellPrefab = cellPrefabs.Find(x => x.type == type);
            if (cellPrefab == null) return;

            Instantiate(cellPrefab.prefab, position, Quaternion.identity);
        }
開發者ID:Sundem,項目名稱:TD,代碼行數:7,代碼來源:BoardManager.cs

示例7: GenerateGround

 public static CellType[] GenerateGround(string seed, int islandSize, int seedBase, float noiseSize, float falloffExponent, float threshold)
 {
     var cells = new CellType[islandSize * islandSize];
     var seedHash = seedBase + seed.GetHashCode();
     // These weird nubers are 'random' prime numbers
     var seedX = seedHash % 65521;
     var seedY = (seedHash * 45949) % 31147;
     var spacing = noiseSize / islandSize;
     var offset = (spacing - noiseSize) * 0.5f;
     var center = islandSize * 0.5f;
     var radius = islandSize * Mathf.Sqrt(0.5f);
     for (var row = 0; row < islandSize; ++row) {
         for (var column = 0; column < islandSize; ++column) {
             if (row == 0 || column == 0 || row == islandSize - 1 || column == islandSize - 1) {
                 cells[row * islandSize + column] = CellType.Water;
             } else {
                 var x = seedX + offset + row * spacing;
                 var y = seedY + offset + column * spacing;
                 var distanceToCenter =
                     Vector2.Distance(
                         new Vector2(row, column),
                         new Vector2(center, center))
                         / radius;
                 var sample = Mathf.PerlinNoise(x, y) * (1.0f - Mathf.Pow(distanceToCenter, falloffExponent));
                 cells[row * islandSize + column] = sample > threshold ? CellType.Ground : CellType.Water;
             }
         }
     }
     return cells;
 }
開發者ID:kmichel,項目名稱:passeur,代碼行數:30,代碼來源:Island.cs

示例8: World

        public World(int moveIndex, int width, int height, Player[] players, Trooper[] troopers, Bonus[] bonuses,
            CellType[][] cells, bool[] cellVisibilities)
        {
            this.moveIndex = moveIndex;
            this.width = width;
            this.height = height;

            this.players = new Player[players.Length];
            Array.Copy(players, this.players, players.Length);

            this.troopers = new Trooper[troopers.Length];
            Array.Copy(troopers, this.troopers, troopers.Length);

            this.bonuses = new Bonus[bonuses.Length];
            Array.Copy(bonuses, this.bonuses, bonuses.Length);

            this.cells = new CellType[width][];
            for (int x = 0; x < width; ++x)
            {
                this.cells[x] = new CellType[cells[x].Length];
                Array.Copy(cells[x], this.cells[x], cells[x].Length);
            }

            this.cellVisibilities = cellVisibilities;
        }
開發者ID:Evander83,項目名稱:AICup-2013,代碼行數:25,代碼來源:World.cs

示例9: Start

		/*/// <summary>
		/// Surface molecular pattern of the cell. An array of bits each of which represents a nucleotide.
		/// </summary>
		public MolecularPattern Pattern
		{
			get { return pattern; }
		}*/

		#endregion

		#region Public Methods

		/*public Cell(CellType type, ITissue parent, MolecularPattern initialPattern)
		{
			Type = type;
			Parent = parent;
			pattern = initialPattern;
			maturationLevel = CellMaturationLevel.Immature;
			Start();
		}*/

		public Cell(CellType type, ITissue parent)
		{
			Type = type;
			Parent = parent;
			maturationLevel = CellMaturationLevel.Immature;
			Start();
		}
開發者ID:sawat80,項目名稱:Simulais,代碼行數:28,代碼來源:Cells.cs

示例10: FromString

        /// <summary>
        /// Creates a GameField object from the given string
        /// </summary>
        /// <param name="fieldData">The field data.</param>
        /// <returns></returns>
        public static GameField FromString(string fieldData)
        {
            var rows = fieldData.Split(new[] {";"}, StringSplitOptions.RemoveEmptyEntries);
            var rowList = new List<CellType[]>();

            foreach (var row in rows)
            {
                var rowData = row
                    .Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries)
                    .Select(ToCellType)
                    .ToArray();

                rowList.Add(rowData);
            }

            int width = rowList.First().Length;
            int heigth = rows.Length;

            // Construct and Initialize Grid
            var gridData = new CellType[heigth][];
            for (int y = 0; y < heigth; y++)
            {
                gridData[y] = new CellType[width];
                for (int x = 0; x < width; x++)
                {
                    gridData[y][x] = CellType.Empty;
                }
            }

            return new GameField(new Size(width, heigth), gridData);
        }
開發者ID:bReChThOu,項目名稱:WarlightBlockBattle,代碼行數:36,代碼來源:FieldHelper.cs

示例11: GetMergedRange

        public CellRange GetMergedRange(C1FlexGrid grid, CellType cellType, CellRange rg)
        {
            // we are only interested in data cells
            // (not merging row or column headers)
            if (cellType == CellType.Cell)
            {
                // expand left/right
                for (int i = rg.Column; i < grid.Columns.Count - 1; i++)
                {
                    if (GetDataDisplay(grid, rg.Row, i) != GetDataDisplay(grid, rg.Row, i + 1)) break;
                    rg.Column2 = i + 1;
                }
                for (int i = rg.Column; i > 0; i--)
                {
                    if (GetDataDisplay(grid, rg.Row, i) != GetDataDisplay(grid, rg.Row, i - 1)) break;
                    rg.Column = i - 1;
                }

                // expand up/down
                for (int i = rg.Row; i < grid.Rows.Count - 1; i++)
                {
                    if (GetDataDisplay(grid, i, rg.Column) != GetDataDisplay(grid, i + 1, rg.Column)) break;
                    rg.Row2 = i + 1;
                }
                for (int i = rg.Row; i > 0; i--)
                {
                    if (GetDataDisplay(grid, i, rg.Column) != GetDataDisplay(grid, i - 1, rg.Column)) break;
                    rg.Row = i - 1;
                }
            }

            // done
            return rg;
        }
開發者ID:mdjabirov,項目名稱:C1Decompiled,代碼行數:34,代碼來源:MyMergeManager.cs

示例12: SetCell

		public void SetCell(int x, int y, CellType c)
		{
			if (x < 0 || x >= cells.GetLength(0) || y < 0 || y >= cells.GetLength(1))
				return;

			switch (c)
			{
				case CellType.Passable:
				case CellType.Impassable:
					if ((StartX == x && StartY == y) || (FinishX == x && FinishY == y))
						return;
					break;

				case CellType.Start:
					if (cells[x, y] == -2 || cells[x, y] == -4) // don't change if its impassable or "finish"
						return;

					cells[StartX, StartY] = -1;
					StartX = x;
					StartY = y;
					break;

				case CellType.Finish:
					if (cells[x, y] == -2 || cells[x, y] == -3) // don't change if its impassable or "start"
						return;

					cells[FinishX, FinishY] = -1;
					FinishX = x;
					FinishY = y;
					break;
			}

			cells[x, y] = -(int)c - 1;
		}
開發者ID:Download,項目名稱:Irrlicht-Lime,代碼行數:34,代碼來源:Pathfinding.cs

示例13: Cell

 public Cell(int y, int x, CellType cellType)
 {
     Gold = 0;
     Y = y;
     X = x;
     CellType = cellType;
 }
開發者ID:Sewil,項目名稱:ATeam-DDO,代碼行數:7,代碼來源:Cell.cs

示例14: init

    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;
    }
開發者ID:jyzgo,項目名稱:SodaLikeDemo,代碼行數:7,代碼來源:BombEff.cs

示例15: DBCFileComparer

 public DBCFileComparer(string oldFile, string newFile, int testAmount, CellType[] knownColumnStructure)
 {
     oldReader = new DBCReader(oldFile);
     newReader = new DBCReader(newFile);
     this.knownColumnStructure = knownColumnStructure;
     this.testAmount = testAmount;
 }
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:7,代碼來源:DBCFileComparer.cs


注:本文中的CellType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。