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


C# MoveType类代码示例

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


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


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