• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MoveType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Move

 public Move(Piece promoteTo, Coordinate from, Coordinate to)
 {
     m_moveType = MoveType.Promotion;
     m_promoteTo = promoteTo;
     m_from = from;
     m_to = to;
 }
开发者ID:Kashll,项目名称:Chess,代码行数:7,代码来源:Move.cs


示例2: PlayAgainstFriend

        public ActionResult PlayAgainstFriend(MoveType moveOne, MoveType moveTwo, MoveType moveThree, Guid roundId)
        {
            // Play moves
            _bus.Send(new PlayMoves(Player.Id, roundId, moveOne, moveTwo, moveThree));

            return RedirectToAction("PlaySummary", "Player");
        }
开发者ID:payman81,项目名称:Ran-Nan-Doh-1,代码行数:7,代码来源:GameController.cs


示例3: PrepareForLanding

 public void PrepareForLanding(Vector2 landPosition, Vector2 planetPosition)
 {
     var method = new LandingMove (landPosition, planetPosition);
     method.Landed += MoveOnPlanet;
     actualMethod = method;
     type = MoveType.Landing;
 }
开发者ID:IAmEska,项目名称:PlanetShooter,代码行数:7,代码来源:MovementManager.cs


示例4: ToggleMoveType

 public void ToggleMoveType()
 {
     if (moveType == MoveType.MOVE_POSITION)
         moveType = MoveType.NONE;
     else
         moveType = MoveType.MOVE_POSITION;
 }
开发者ID:Zatchmeister,项目名称:Dias,代码行数:7,代码来源:CharacterMoveScript.cs


示例5: StateTypeSet

 public StateTypeSet(StateSystem statesystem, String label, TextSection textsection)
     : base(statesystem, label, textsection)
 {
     m_statetype = textsection.GetAttribute<StateType>("statetype", StateType.Unchanged);
     m_movetype = textsection.GetAttribute<MoveType>("movetype", MoveType.Unchanged);
     m_physics = textsection.GetAttribute<Physics>("Physics", Physics.Unchanged);
 }
开发者ID:lodossDev,项目名称:xnamugen,代码行数:7,代码来源:StateTypeSet.cs


示例6: EvaluateNextMove

        public CollisionType EvaluateNextMove(MoveType move, IFigure figure)
        {
            var collision = CollisionType.None;
            IFigure movedFigure;
            switch (move)
            {
                case MoveType.RowAdded:
                    collision = ResolveRowAdded();
                    break;
                case MoveType.MoveRight:
                    movedFigure = figure.MoveRight();
                    collision = ResolveMoveRight(movedFigure);
                    break;
                case MoveType.MoveLeft:
                    movedFigure = figure.MoveLeft();
                    collision = ResolveMoveLeft(movedFigure);
                    break;
                case MoveType.MoveDown:
                    movedFigure = figure.MoveDown();
                    collision = ResolveMoveDown(movedFigure);
                    break;
                case MoveType.TossDown:
                    // for now do nothing
                    break;
                case MoveType.Rotate:
                    var rotatedFigure = figure.RotateClockwise();
                    collision = ResolveRotate(rotatedFigure);
                    break;
                default:
                    throw new NotImplementedException("unknown movement type: " + move);
            }

            return collision;
        }
开发者ID:MarkiyanMatsekh,项目名称:MultiplayerTetris,代码行数:34,代码来源:CollisisonDetector.cs


示例7: CheckProbabilities

 //determine the outcome of the current move action
 void CheckProbabilities()
 {
     switch (movementType) {
     case MoveType.HORIZONTAL: {
         if (Random.value < probabilities.horizontal * indicatorMultiplier) {
             MoveLandSlide(-1);
         } else {
             movementType = MoveType.NONE;
             //probabilities.horizontal += 0.1f;
             //probabilities.vertical /= 1.5f;
         }
         break;
     }
     case MoveType.VERTICAL: {
         if (Random.value < probabilities.vertical * indicatorMultiplier) {
             MoveLandSlide(-2);
         } else {
             movementType = MoveType.NONE;
             probabilities.horizontal *= additionalLandSlideChance_vertical;
             probabilities.vertical *= additionalLandSlideChance_vertical;
         }
         break;
     }
     case MoveType.LANDSLIDE: {
         movementType = MoveType.NONE;
         ResetProbabilities();
         break;
         }
     }
 }
开发者ID:dun1007,项目名称:AntLion,代码行数:31,代码来源:AntBehaviour.cs


示例8: Ball

        public Ball(Color color, PointF point, float jumpSpeed, float radius, Frame frame, Direction direction)
        {
            this.pen = new Pen(color);
            this.frame = frame;
            this.x = point.X;
            this.y = point.Y;
            this.jumpSpeed = jumpSpeed;
            this.radius = radius;

            switch (direction)
            {
                case Direction.DOWN:
                    xmt = MoveType.Down;
                    ymt = MoveType.Down;
                    break;
                case Direction.LEFT:
                    xmt = MoveType.Up;
                    ymt = MoveType.Down;
                    break;
                case Direction.RIGHT:
                    xmt = MoveType.Down;
                    ymt = MoveType.Up;
                    break;
                case Direction.UP:
                    xmt = MoveType.Up;
                    ymt = MoveType.Up;
                    break;
            }
        }
开发者ID:davidbedok,项目名称:oeprogvep,代码行数:29,代码来源:Ball.cs


示例9: CheckLastMove

 public bool CheckLastMove([NotNull] IList<MoveType> moves, MoveType lastMove)
 {
     if (lastMove == MoveType.NW || lastMove == MoveType.NE)
         return false;
     if (lastMove == MoveType.SW || lastMove == MoveType.SE)
         return true;
     if (symmetric == 1)
     {
         if (lastMove == MoveType.RotateCCW || lastMove == MoveType.RotateCW)
             return false;
         var prevMove = moves.Any() ? moves.Last() : (MoveType?)null;
         if (lastMove == MoveType.E && prevMove == MoveType.W)
             return false;
         if (lastMove == MoveType.W && prevMove == MoveType.E)
             return false;
         return true;
     }
     var used = new HashSet<Tuple<int, int>>();
     var position = Tuple.Create(0, 0);
     used.Add(position);
     position = ApplyMove(lastMove, position);
     if (position == null)
         throw new InvalidOperationException("Position couldn't be null here");
     used.Add(position);
     for (var i = moves.Count - 1; i >= 0; i--)
     {
         position = ApplyMove(moves[i], position);
         if (position == null)
             return true;
         if (!used.Add(position))
             return false;
     }
     return true;
 }
开发者ID:spaceorc,项目名称:icfpc2015,代码行数:34,代码来源:ForbiddenSequenceChecker.cs


示例10: Vector

 public Vector(MoveType move, int y, int length = 1)
 {
     switch (move)
     {
         case MoveType.E:
             X = length;
             break;
         case MoveType.W:
             X = -length;
             break;
         case MoveType.SW:
             Y = length;
             X = GetWestDX(y, length);
             break;
         case MoveType.SE:
             Y = length;
             X = GetEastDX(y, length);
             break;
         case MoveType.NW:
             Y = -length;
             X = GetWestDX(y, length);
             break;
         case MoveType.NE:
             Y = -length;
             X = GetEastDX(y, length);
             break;
         default:
             throw new ArgumentOutOfRangeException(move.ToString(), move, null);
     }
 }
开发者ID:spaceorc,项目名称:icfpc2015,代码行数:30,代码来源:Vector.cs


示例11: isWall

 public bool isWall(MoveType type)
 {
     bool collide = false;
     switch (type)
     {
         case MoveType.Down:
             if (point.Y > GameConsole.Height)
             {
                 collide = true;
             }
             break;
         case MoveType.Up:
             if (point.Y >= 0){
                 collide = true;
             }
             break;
         case MoveType.Left:
             if (point.X <= 0 )
             {
                 collide = true;
             }
             break;
         case MoveType.Right:
             if (point.X > GameConsole.Width)
             {
                 collide = true;
             }
             break;
     }
     return collide;
 }
开发者ID:booirror,项目名称:C-sharp-codes,代码行数:31,代码来源:Bullet.cs


示例12: HandleInput

        public void HandleInput(float dt)
        {
            float mvSpd = walkSpeed;

            if (myController.Sprint.Down && (currentMoveType == MoveType.RUN || currentMoveType == MoveType.WALK))
            {
                currentMoveType = MoveType.RUN;
                mvSpd = runSpeed;
            }
            else if (currentMoveType == MoveType.RUN)
            {
                currentMoveType = MoveType.WALK;
            }

            if (Math.Abs(myController.Movement.X) > 0.1f)
            {
                myMotion.X = myController.Movement.X * mvSpd;
            }
            else
            {
                myMotion.X = 0.0f;
            }

            if (Math.Abs(myController.Movement.Y) > 0.1f)
            {
                myMotion.Y = myController.Movement.Y * mvSpd;
            }
            else
            {
                myMotion.Y = 0.0f;
            }
        }
开发者ID:DrMelon,项目名称:SpaceQuestionmark,代码行数:32,代码来源:MobMovement.cs


示例13: PageData

 public PageData(int pageLevel, Genre pageGenre, MoveType pageType, bool isRare)
 {
     m_pageLevel = pageLevel;
     m_pageGenre = pageGenre;
     m_pageType = pageType;
     m_isRare = isRare;
     m_inventoryId = -1;
 }
开发者ID:Awesome-MQP,项目名称:Storybook,代码行数:8,代码来源:PageData.cs


示例14: MoveOnPlanet

    public void MoveOnPlanet(Vector2 planetPosition)
    {
        if (actualMethod is LandingMove)
            (actualMethod as LandingMove).Landed -= MoveOnPlanet;

        actualMethod = new LandMove (planetPosition);
        type = MoveType.LandMove;
    }
开发者ID:IAmEska,项目名称:PlanetShooter,代码行数:8,代码来源:MovementManager.cs


示例15: Move

 public Move(int Piece, Position StartPosition, Position EndPosition, MoveType Type, Position MiddlePosition = Position.None)
 {
     this.Piece = Piece;
     this.StartPosition = StartPosition;
     this.EndPosition = EndPosition;
     this.MiddlePosition = MiddlePosition;
     this.Type = Type;
 }
开发者ID:omahlama,项目名称:Limake,代码行数:8,代码来源:Move.cs


示例16: MoveResult

        public MoveResult(MoveType type, CheckersPiece piece, int nx, int ny)
        {
            Type = type;
            OriginalPieceLocation = new Location(piece.X, piece.Y);
            FinalPieceLocation = new Location(nx, ny);

            JumpResults = new List<JumpResult>();
        }
开发者ID:mohammedh123,项目名称:ProjectAlphaBeta,代码行数:8,代码来源:MoveResult.cs


示例17: Move

    internal void Move(MoveType type, TileController start, TileController stop) {
        string moveType = type == MoveType.Empty
            ? "MoveToEmpty"
            : type == MoveType.Merge ? "MoveToMerge" : type == MoveType.Attack ? "MoveToAttack" : "";

        _tcpClient.Send(string.Format("[Notify:{0}:{1}|({2}:{3})|({4}:{5})]", moveType, _guid, start.Position.x,
            start.Position.y, stop.Position.x, stop.Position.y));
    }
开发者ID:BornToGrill,项目名称:Project-Frequency,代码行数:8,代码来源:Notify.cs


示例18: LogMove

        /// <summary>
        /// Log a game move to the logging session
        /// </summary>
        /// <param name="player"></param>
        /// <param name="timeOfMove"></param>
        /// <param name="moveType"></param>
        public void LogMove(string player, int timeOfMove, MoveType moveType)
        {
            if (_gameData == null)
            {
                throw new InvalidOperationException("The logging session has not begun. Unable to log move.");
            }

            _gameData.AddGameMoveDataPoint(player, timeOfMove, moveType);
        }
开发者ID:jonathanyeung,项目名称:ozwego,代码行数:15,代码来源:GameDataLogger.cs


示例19: MoveWon

        public bool MoveWon(MoveType move1, MoveType move2)
        {
            if ((move1 == MoveType.Punch && move2 == MoveType.Block) ||
                (move1 == MoveType.Kick && move2 == MoveType.Punch) ||
                (move1 == MoveType.Block && move2 == MoveType.Kick))
                return true;

            return false;
        }
开发者ID:payman81,项目名称:Ran-Nan-Doh,代码行数:9,代码来源:MoveCalculator.cs


示例20: CoordCmd

 private CoordCmd(double? x, double? y, double? z, double? a, MoveType type)
 {
     Contract.Assert(x.HasValue || y.HasValue || z.HasValue || a.HasValue);
     X = x;
     Y = y;
     Z = z;
     A = a;
     Type = type;
 }
开发者ID:anroOfCode,项目名称:puzzleBot,代码行数:9,代码来源:CncMachine.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Movement类代码示例发布时间:2022-05-24
下一篇:
C# MoveDirection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap