AStarXNA.Game1.HandleLeftButton C# (CSharp) Метод

HandleLeftButton() приватный Метод

private HandleLeftButton ( Point position ) : void
position Point
Результат void
        void HandleLeftButton(Point position)
        {
            var cell = grid.CellAtCoordinate(position.X, position.Y);
            var state = Keyboard.GetState();
            if (state.IsKeyDown(Keys.LeftControl))
            {
                SetCellType(cell, GridCellType.Source);
            }
            else if (state.IsKeyDown(Keys.LeftAlt))
            {
                SetCellType(cell, GridCellType.Destination);
            }
            else
            {
                SetCellType(cell, GridCellType.Unwalkable);
            }
        }