本文整理汇总了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;
}
示例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");
}
示例3: PrepareForLanding
public void PrepareForLanding(Vector2 landPosition, Vector2 planetPosition)
{
var method = new LandingMove (landPosition, planetPosition);
method.Landed += MoveOnPlanet;
actualMethod = method;
type = MoveType.Landing;
}
示例4: ToggleMoveType
public void ToggleMoveType()
{
if (moveType == MoveType.MOVE_POSITION)
moveType = MoveType.NONE;
else
moveType = MoveType.MOVE_POSITION;
}
示例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);
}
示例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;
}
示例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;
}
}
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例14: MoveOnPlanet
public void MoveOnPlanet(Vector2 planetPosition)
{
if (actualMethod is LandingMove)
(actualMethod as LandingMove).Landed -= MoveOnPlanet;
actualMethod = new LandMove (planetPosition);
type = MoveType.LandMove;
}
示例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;
}