本文整理汇总了C#中MoveType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MoveType.ToString方法的具体用法?C# MoveType.ToString怎么用?C# MoveType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoveType
的用法示例。
在下文中一共展示了MoveType.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: HandleMovement
private void HandleMovement(MoveType move)
{
_log.Log(move.ToString());
_moveHandler.HandleMove(move);
}
示例3: Move
public Unit Move(MoveType move, int steps = 1)
{
switch (move)
{
case MoveType.E:
case MoveType.W:
case MoveType.SW:
case MoveType.SE:
case MoveType.NE:
case MoveType.NW:
return new Unit { pivot = pivot.Move(new Vector(move, pivot.y, steps)), members = new HashSet<Cell>(members.Select(cell => cell.Move(new Vector(move, cell.y, steps)))) };
case MoveType.RotateCW:
return new Unit { pivot = pivot, members = new HashSet<Cell>(members.Select(cell => cell.RotateCW(pivot))) };
case MoveType.RotateCCW:
return new Unit { pivot = pivot, members = new HashSet<Cell>(members.Select(cell => cell.RotateCCW(pivot))) };
default:
throw new ArgumentOutOfRangeException(move.ToString(), move, null);
}
}