本文整理汇总了C#中Positions类的典型用法代码示例。如果您正苦于以下问题:C# Positions类的具体用法?C# Positions怎么用?C# Positions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Positions类属于命名空间,在下文中一共展示了Positions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetEnablePositions
public override void SetEnablePositions(ISituation situation, out Positions enableMovein, out Positions enableCapture)
{
enableCapture = new Positions();
enableMovein = new Positions();
Position aPos = this.Position.ShiftWestNorth();
Position bPos = this.Position.ShiftEastNorth();
Position cPos = this.Position.ShiftWestSouth();
Position dPos = this.Position.ShiftEastSouth();
if (aPos != Position.Empty)
{
Position.Shift(this.GameSide, situation, aPos.ShiftNorth(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, aPos.ShiftWest(), enableMovein, enableCapture);
}
if (bPos != Position.Empty)
{
Position.Shift(this.GameSide, situation, bPos.ShiftNorth(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, bPos.ShiftEast(), enableMovein, enableCapture);
}
if (cPos != Position.Empty)
{
Position.Shift(this.GameSide, situation, cPos.ShiftWest(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, cPos.ShiftSouth(), enableMovein, enableCapture);
}
if (dPos != Position.Empty)
{
Position.Shift(this.GameSide, situation, dPos.ShiftEast(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, dPos.ShiftSouth(), enableMovein, enableCapture);
}
}
示例2: moveNewton
public void moveNewton(Positions newPosition)
{
if( newPosition == Positions.LEVEL1 ){
transform.position = new Vector3(-77.31179f, 1.984234f, 1.453054f);
}
newtonPosition = newPosition;
}
示例3: isAlive
/// <summary>
/// Vérifie si une variable de type Position est en cours ou à déjà été clôturée
/// </summary>
/// <param name="position">Used position</param>
/// <returns>true si la position est active, false sinon</returns>
public static bool isAlive(this Position position, Positions positions)
{
var request = from p in positions select p.Id==position.Id ;
return request!=null;
}
示例4: movePlatform
void movePlatform()
{
stepCount++;
if(stepCount >=stepTimer)
{
switch(platformDirection)
{
case Positions.LEFT:
offSet = new Vector3(-stepSize, 0,0);
platformPosition--;
break;
case Positions.RIGHT:
offSet = new Vector3(stepSize, 0,0);
platformPosition++;
break;
}
this.transform.position += offSet;
//Cambio de direccion
if(platformDirection.Equals(platformPosition))
{
if(platformDirection.Equals(Positions.RIGHT))
{
platformDirection = Positions.LEFT;
}
else
{
platformDirection = Positions.RIGHT;
}
}
}
}
示例5: SetEnablePositions
public override void SetEnablePositions(ISituation situation, out Positions enableMovein, out Positions enableCapture)
{
enableMovein = new Positions();
enableCapture = new Positions();
PieceRook.RookShift(this.GameSide, situation, this.Position, enableMovein, enableCapture);
PieceBishop.BishopShift(this.GameSide, situation, this.Position, enableMovein, enableCapture);
}
示例6: AddVToPosCommand
public AddVToPosCommand(Graph gr,Positions pos,int x, int y)
{
innGraph = gr;
_pos = pos;
_x = x;
_y = y;
}
示例7: Post
public IHttpActionResult Post([FromBody]AddNewPositionModel model)
{
var term = termManager.GetById(model.termId);
ClientTermViewModel result = null;
var product = productManager.GetById(model.productId);
var user = userManager.GetByLogin(model.Login);
if (user != null && user.Token == model.Token &&
product != null && term != null)
{
var newPosition = new Positions()
{
Amount = 1, //TODO
Description = product.Name,
ProductId = product.Id,
Price = product.Price,
OrderId = term.OrderId,
};
positionsManager.AddEntity(newPosition);
var newTermPosition = new TermPositions()
{
TermId = term.Id,
Amount = 1, //TODO
Positions = newPosition,
TermPositionMaterialRsps = new List<TermPositionMaterialRsp>()
};
term.TermPositions.Add(newTermPosition);
//add linked material to position
foreach (var material in product.ProductMaterialRsps.Where(o => !o.DeleteDate.HasValue))
{
newTermPosition.TermPositionMaterialRsps.Add(new TermPositionMaterialRsp()
{
Amount = material.Amount,
MaterialId = material.MaterialId,
TermPositions = newTermPosition
});
}
positionsManager.SaveChanges();
if (term != null)
{
result = TermViewModelHelper.ToModel(term, true, false);
}
return Ok(result);
}
return BadRequest();
}
示例8: Opposite
/// <summary>
/// Returns Positions.Left if the position is Positions.Right,
/// Positions.Right if the position is Left, or the position
/// otherwise.
/// </summary>
/// <param name="position"></param>
public static Positions Opposite(Positions position)
{
if (position == Positions.Left)
return Positions.Right;
if (position == Positions.Right)
return Positions.Left;
return position;
}
示例9: Worker
public Worker(string Name, int Age, Positions Position, double Wage, int BranchID)
{
this.Name = Name;
this.Age = Age;
this.Position = Position;
this.Wage = Wage;
this.BranchID = BranchID;
}
示例10: moveNewton
public void moveNewton(Positions newPosition)
{
if( newPosition == Positions.LAB ){
transform.position = new Vector3(-4.748125f, 1.238406f, -8.060616f);
} else if ( newPosition == Positions.LEVEL1 ){
transform.position = new Vector3(-35.4f, 1.238406f, -26.3f);
}
newtonPosition = newPosition;
}
示例11: VertexVievModel
public VertexVievModel(Vertex v, Graph g, Positions p, Names n)
{
vertex= v;
graph = g;
positionedGraph = p;
namedGraph = n;
}
示例12: Start
void Start()
{
state = States.INTRO;
newtonPosition = Positions.LAB;
fpsInput = GameObject.Find("Player").GetComponent("FPSInputController") as FPSInputController;
consoleController = GameObject.Find("console").GetComponent("ConsoleController") as ConsoleController;
gameController = GameObject.Find("Controller").GetComponent("GameController") as GameController;
ramTrigger = GameObject.Find("ram").GetComponent("RamTrigger") as RamTrigger;
Player = GameObject.Find("Player");
}
示例13: GetDepth
/// <summary>
/// Calls GetDepth and SetDepth.
/// </summary>
/// <param name="geomIndex"></param>
/// <param name="posIndex"></param>
/// <returns></returns>
public int this[int geomIndex, Positions posIndex]
{
get
{
return GetDepth(geomIndex, posIndex);
}
set
{
SetDepth(geomIndex, posIndex, value);
}
}
示例14: LoadWindow
public void LoadWindow(Control control, Positions position)
{
if (position == Positions.Main)
{
flowLayoutPanelMain.Controls.Clear();
flowLayoutPanelMain.Controls.Add(control);
}
else if(position == Positions.Navigation)
{
flowLayoutPanelWest.Controls.Clear();
flowLayoutPanelWest.Controls.Add(control);
}
}
示例15: SetEnablePositions
public override void SetEnablePositions(ISituation situation, out Positions enableMovein, out Positions enableCapture)
{
enableMovein = new Positions();
enableCapture = new Positions();
Position.Shift(this.GameSide, situation, this.Position.ShiftEast(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, this.Position.ShiftSouth(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, this.Position.ShiftWest(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, this.Position.ShiftNorth(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, this.Position.ShiftEastNorth(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, this.Position.ShiftEastSouth(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, this.Position.ShiftWestNorth(), enableMovein, enableCapture);
Position.Shift(this.GameSide, situation, this.Position.ShiftWestSouth(), enableMovein, enableCapture);
}