当前位置: 首页>>代码示例>>C#>>正文


C# Cell类代码示例

本文整理汇总了C#中Cell的典型用法代码示例。如果您正苦于以下问题:C# Cell类的具体用法?C# Cell怎么用?C# Cell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Cell类属于命名空间,在下文中一共展示了Cell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Reify

 public Output Reify(
     Cell<IMaybe<Size>> size,
     Stream<MouseEvent> sMouse, Stream<KeyEvent> sKey,
     Cell<long> focus, Supply idSupply)
 {
     return this.reify(size, sMouse, sKey, focus, idSupply);
 }
开发者ID:Angeldude,项目名称:sodium,代码行数:7,代码来源:Fridget.cs

示例2: SetEndingCell

		void SetEndingCell(GridDungeonModel model, Cell cell) {
			var roomCenter = MathUtils.GridToWorld(model.Config.GridCellSize, cell.CenterF);

            // Destroy all old level goal objects
            var oldGoals = GameObject.FindObjectsOfType<DAShooter.LevelGoal>();
            foreach (var oldGoal in oldGoals)
            {
                var oldGoalObj = oldGoal.gameObject;
                if (oldGoalObj != null)
                {
                    if (Application.isPlaying)
                    {
                        Destroy(oldGoalObj);
                    }
                    else
                    {
                        DestroyImmediate(oldGoalObj);
                    }
                }
            }

			var goal = Instantiate(levelEndGoalTemplate) as GameObject;
            goal.transform.position = roomCenter;

            if (goal.GetComponent<DAShooter.LevelGoal>() == null)
            {
                Debug.LogWarning("No LevelGoal component attached to the Level goal prefab.  cleanup will not be proper");
            }
		}
开发者ID:coderespawn,项目名称:dungeon-architect-quick-start-unity,代码行数:29,代码来源:SpecialRoomFinder.cs

示例3: Clear

 public override void Clear(Cell cell)
 {
     foreach (var item in _effects)
     {
         item.Clear(cell);
     }
 }
开发者ID:drock07,项目名称:SadConsole,代码行数:7,代码来源:ConcurrentEffect.cs

示例4: LoadLevel

 public Cell[,] LoadLevel(int level_nr)
 {
     Cell[,] cell = null;
     string[] lines;
     try
     {
         lines = File.ReadAllLines(filename);
     }
     catch
     {
         return cell;
     }
     int curr = 0;
     int curr_level_nr = 0;
     int width;
     int height;
     while (curr < lines.Length)
     {
         ReadLevelHeader(lines[curr], out curr_level_nr, out width, out height);
         if (level_nr == curr_level_nr)
         {
             cell = new Cell[width, height];
             for (int y = 0; y < height; y++)
                 for (int x = 0; x < width; x++)
                     cell[x, y] = CharToCell(lines[curr + 1 + y][x]);
             break;
         }
         else
             curr = curr + 1 + height;
     }
     return cell;
 }
开发者ID:hely80,项目名称:Sokoban,代码行数:32,代码来源:LevelFile.cs

示例5: GetCellCore

		protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
		{
			Performance.Start();
			var cell = (ViewCell)item;

			var container = convertView as ViewCellContainer;
			if (container != null)
			{
				container.Update(cell);
				Performance.Stop();
				return container;
			}

			BindableProperty unevenRows = null, rowHeight = null;
			if (ParentView is TableView)
			{
				unevenRows = TableView.HasUnevenRowsProperty;
				rowHeight = TableView.RowHeightProperty;
			}
			else if (ParentView is ListView)
			{
				unevenRows = ListView.HasUnevenRowsProperty;
				rowHeight = ListView.RowHeightProperty;
			}

			IVisualElementRenderer view = Platform.CreateRenderer(cell.View);
			Platform.SetRenderer(cell.View, view);
			cell.View.IsPlatformEnabled = true;
			var c = new ViewCellContainer(context, view, cell, ParentView, unevenRows, rowHeight);

			Performance.Stop();

			return c;
		}
开发者ID:cosullivan,项目名称:Xamarin.Forms,代码行数:34,代码来源:ViewCellRenderer.cs

示例6: GetPath

        private static void GetPath(char[,] matrix, Cell start, Cell end, ref bool foundExit)
        {
            if (foundExit)
            {
                return;                                     // already found the solution and other cases are not interesting
            }

            if (start.Row >= matrix.GetLength(0) || start.Row < 0 || start.Col >= matrix.GetLength(1) || start.Col < 0)
            {
                return;                                     // the cell is outside the matrix
            }

            if (matrix[start.Row, start.Col] == '*')
            {
                return;                                     // the cell is not passable
            }

            if (start.Equals(end))
            {
                foundExit = true;                           // found exit
                return;
            }

            matrix[start.Row, start.Col] = '*';
            GetPath(matrix, new Cell(start.Row + 1, start.Col), end, ref foundExit);
            GetPath(matrix, new Cell(start.Row, start.Col + 1), end, ref foundExit);
            GetPath(matrix, new Cell(start.Row - 1, start.Col), end, ref foundExit);
            GetPath(matrix, new Cell(start.Row, start.Col - 1), end, ref foundExit);
            matrix[start.Row, start.Col] = ' ';
        }
开发者ID:kalinalazarova1,项目名称:TelerikAcademy,代码行数:30,代码来源:PathExists.cs

示例7: GetCell

		public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
		{
			var entryCell = (EntryCell)item;

			var tvc = reusableCell as EntryCellTableViewCell;
			if (tvc == null)
				tvc = new EntryCellTableViewCell(item.GetType().FullName);
			else
			{
				tvc.Cell.PropertyChanged -= OnCellPropertyChanged;
				tvc.TextFieldTextChanged -= OnTextFieldTextChanged;
				tvc.KeyboardDoneButtonPressed -= OnKeyBoardDoneButtonPressed;
			}

			SetRealCell(item, tvc);

			tvc.Cell = item;
			tvc.Cell.PropertyChanged += OnCellPropertyChanged;
			tvc.TextFieldTextChanged += OnTextFieldTextChanged;
			tvc.KeyboardDoneButtonPressed += OnKeyBoardDoneButtonPressed;

			WireUpForceUpdateSizeRequested(item, tvc, tv);

			UpdateBackground(tvc, entryCell);
			UpdateLabel(tvc, entryCell);
			UpdateText(tvc, entryCell);
			UpdateKeyboard(tvc, entryCell);
			UpdatePlaceholder(tvc, entryCell);
			UpdateLabelColor(tvc, entryCell);
			UpdateHorizontalTextAlignment(tvc, entryCell);
			UpdateIsEnabled(tvc, entryCell);

			return tvc;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:34,代码来源:EntryCellRenderer.cs

示例8: GetCellCore

		protected override global::Android.Views.View GetCellCore(Cell item, global::Android.Views.View convertView, ViewGroup parent, Context context)
		{
			if ((_view = convertView as EntryCellView) == null)
				_view = new EntryCellView(context, item);
			else
			{
				_view.TextChanged = null;
				_view.FocusChanged = null;
				_view.EditingCompleted = null;
			}

			UpdateLabel();
			UpdateLabelColor();
			UpdatePlaceholder();
			UpdateKeyboard();
			UpdateHorizontalTextAlignment();
			UpdateText();
			UpdateIsEnabled();
			UpdateHeight();

			_view.TextChanged = OnTextChanged;
			_view.EditingCompleted = OnEditingCompleted;

			return _view;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:25,代码来源:EntryCellRenderer.cs

示例9: AddCell

        public CellTag AddCell(Cell cell, string tagName)
        {
            var child = new CellTag(cell, tagName);
            Append(child);

            return child;
        }
开发者ID:GaryLCoxJr,项目名称:storyteller,代码行数:7,代码来源:GrammarTag.cs

示例10: MoveAction

        byte WAIT_TICKS = 30; // How many ticks to wait for another unit to move.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// This constructor will create a MoveAction to the given targetX, and targetY.
        /// </summary>
        /// <param name="targetX">X coordinate destination of the move action in game space.</param>
        /// <param name="targetY">Y coordinate destination of the move action in game space.</param>
        /// <param name="gw">The GameWorld that the move action is occurring in.</param>
        /// <param name="entity">The Entity being given the MoveAction. (Should only be given to Units)</param>
        public MoveAction(float targetX, float targetY, GameWorld gw, Entity entity)
        {
            this.actionType = ActionType.Move;
            this.targetY = targetY;
            this.targetX = targetX;
            this.entity = entity;
            this.gw = gw;
            unit = (Unit)entity;
            float startX = unit.x;
            float startY = unit.y;

            if ((int)targetX >= gw.map.width || (int)targetX < 0 || (int)targetY >= gw.map.height || (int)targetY < 0)
            {
                // Invalid target position.
                path = new List<Cell>();
            }
            else
            {
                path = findPath.between(gw.map, gw.map.getCell((int)startX, (int)startY), gw.map.getCell((int)targetX, (int)targetY));

                // Don't bother with path if it is just to same cell.
                if (path.Count > 1)
                {
                    targetCell = path[1];
                    cellIndex = 1;
                }
                else
                {
                    path = new List<Cell>();
                }
            }
        }
开发者ID:BGCX261,项目名称:zombie-real-time-strategy-game-svn-to-git,代码行数:45,代码来源:MoveAction.cs

示例11: Load

        public bool Load(Stream gnd)
        {
            BinaryReader br = new BinaryReader(gnd);
            string header = ((char)br.ReadByte()).ToString() + ((char)br.ReadByte()) + ((char)br.ReadByte()) + ((char)br.ReadByte());

            if (header != "GRAT")
                return false;

            majorVersion = br.ReadByte();
            minorVersion = br.ReadByte();

            if (majorVersion != 1 || minorVersion != 2)
                return false;

            _width = br.ReadInt32();
            _height = br.ReadInt32();

            _cells = new Cell[_width * _height];
            for (int i = 0; i < _cells.Length; i++)
            {
                Cell c = new Cell();

                c.Load(br);

                _cells[i] = c;
            }

            Logger.WriteLine("Altitude v{0}.{1} status: {2}x{3} - {4} cells", majorVersion, minorVersion, _width, _height, _cells.Length);

            return true;
        }
开发者ID:GodLesZ,项目名称:FimbulwinterClient,代码行数:31,代码来源:Altitude.cs

示例12: GridCellInstantiationTest

        public void GridCellInstantiationTest()
        {
            Grid grid;

            // Assert each cell in grid is instantiated and initialized with expected default chemical concentrations
            grid = new Grid(4);
            for (int column = 0; column < grid.Size; column++)
            {
                for (int row = 0; row < grid.Size; row++)
                {
                    Assert.AreEqual(grid[column, row]["A"], 0);
                    Assert.AreEqual(grid[column, row]["B"], 0);
                }
            }

            // Assert each cell in grid is instantiated and initialized with given chemical concentrations
            Cell cell = new Cell
            {
                { "A", 0.25 },
                { "B", 0.75 }
            };
            grid = new Grid(4, cell);
            for (int column = 0; column < grid.Size; column++)
            {
                for (int row = 0; row < grid.Size; row++)
                {
                    Assert.AreEqual(grid[column, row]["A"], 0.25);
                    Assert.AreEqual(grid[column, row]["B"], 0.75);
                }
            }
        }
开发者ID:Clarksj4,项目名称:GrayScottDiffusionReaction,代码行数:31,代码来源:GridTests.cs

示例13: CellTag

 public CellTag(Cell cell, string tag)
     : base(tag)
 {
     AddClass(GrammarConstants.CELL);
     this.AddSafeClassName(cell.Key);
     MetaData(GrammarConstants.KEY, cell.Key);
 }
开发者ID:wbinford,项目名称:storyteller,代码行数:7,代码来源:CellTag.cs

示例14: FindFirstExit

    private static Cell FindFirstExit(Cell startingPoint)
    {
        var path = new Queue<Cell>();
        if (startingPoint != null)
        {
            path.Enqueue(startingPoint);
        }

        while (path.Count > 0)
        {
            var curretnCell = path.Dequeue();

            if (IsExit(curretnCell))
            {
                return curretnCell;
            }

            TryDirection(path, curretnCell, "U", 0, -1);
            TryDirection(path, curretnCell, "R", 1, 0);
            TryDirection(path, curretnCell, "D", 0, 1);
            TryDirection(path, curretnCell, "L", -1, 0);
        }

        return null;
    }
开发者ID:peterkirilov,项目名称:SoftUni-1,代码行数:25,代码来源:EscapeFromLabyrinth.cs

示例15: Edge

        public Edge(int x, int y, Directions direction, int depth)
        {
            origin = new Cell {direction = direction, x = x, y = y, depth = depth};
            exit = new Cell {x = x, y = y, depth = depth + 1};

            switch (origin.direction)
            {
                case Directions.Left:
                    exit.direction = Directions.Right;
                    exit.x -= 1;
                    break;
                case Directions.Right:
                    exit.direction = Directions.Left;
                    exit.x += 1;
                    break;
                case Directions.Down:
                    exit.direction = Directions.Up;
                    exit.y -= 1;
                    break;
                case Directions.Up:
                    exit.direction = Directions.Down;
                    exit.y += 1;
                    break;
            }
        }
开发者ID:reidblomquist,项目名称:ProceduralToolkit,代码行数:25,代码来源:Edge.cs


注:本文中的Cell类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。