本文整理汇总了C#中Side类的典型用法代码示例。如果您正苦于以下问题:C# Side类的具体用法?C# Side怎么用?C# Side使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Side类属于命名空间,在下文中一共展示了Side类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ArgumentCheck
private static void ArgumentCheck(Side side, int m, int n, int k, int ilo, int ihi, Object A, int lda, Object tau, Object C, int ldc) {
if ( A == null ) {
throw new ArgumentNullException("A","A cannot be null.");
}
if ( tau == null ) {
throw new ArgumentNullException("tau","tau cannot be null.");
}
if ( C == null ) {
throw new ArgumentNullException("C","C cannot be null.");
}
if ( m<0 ) {
throw new ArgumentException("m must be at least zero.", "m");
}
if ( n<0 ) {
throw new ArgumentException("n must be at least zero.", "n");
}
if( side == Side.Left ){
if( k < 0 || k > m ){
throw new ArgumentException("k must be positive and less than or equal to m.", "k");
}
if (m>0) {
if (ilo<1 || ilo>m || ilo>ihi)
throw new ArgumentException("ilo must be a positive number and less than or equal to min(ihi,m) if m>0", "ilo");
if (ihi<1 || ihi>m)
throw new ArgumentException("ihi must be between 1 and m if m>0", "ihi");
} else {
if (ilo!=1)
throw new ArgumentException("ilo must be 1 if m=0", "ilo");
if (ihi!=0)
throw new ArgumentException("ihi must be 0 if m=0", "ihi");
}
}else{
if( k < 0 || k > n ){
throw new ArgumentException("k must be positive and less than or equal to n.", "k");
}
if (n>0) {
if (ilo<1 || ilo>n || ilo>ihi)
throw new ArgumentException("ilo must be a positive number and less than or equal to min(ihi,n) if n>0", "ilo");
if (ihi<1 || ihi>n)
throw new ArgumentException("ihi must be a positive number and less than or equal to n if n>0", "ihi");
} else {
if (ilo!=1)
throw new ArgumentException("ilo must be 1 if n=0", "ilo");
if (ihi!=0)
throw new ArgumentException("ihi must be 0 if n=0", "ihi");
}
}
if( side == Side.Left ){
if ( lda < System.Math.Max(1,m) ) {
throw new ArgumentException("lda must be at least max(1,m)", "lda");
}
}else{
if ( lda < System.Math.Max(1,n) ) {
throw new ArgumentException("lda must be at least max(1,n)", "lda");
}
}
if ( ldc < System.Math.Max(1,m) ) {
throw new ArgumentException("ldc must be at least max(1,m)", "ldc");
}
}
示例2: RotateSide
public static Side RotateSide(Side side, int steps)
{
int index = Array.IndexOf(allSides, side);
index += steps;
index = Mathf.CeilToInt(Mathf.Repeat(index, allSides.Length));
return allSides[index];
}
示例3: ArgumentCheck
///<summary>Check arguments so that errors don't occur in native code</summary>
private static void ArgumentCheck( Side side, int m, int n, object A, int lda, object B, int ldb ) {
if ( A == null ) {
throw new ArgumentNullException("A", "A cannot be null.");
}
if ( B == null ) {
throw new ArgumentNullException("B", "B cannot be null.");
}
if ( m < 0) {
throw new ArgumentException("m must be zero or greater", "m");
}
if ( n < 0) {
throw new ArgumentException("n must be zero or greater", "n");
}
if (side == Side.Left) {
if(lda < System.Math.Max(1,m)){
throw new ArgumentException("lda must be at least max(1,m).", "lda");
}
}else{
if(lda < System.Math.Max(1,n)){
throw new ArgumentException("lda must be at least max(1,n).","lda");
}
}
if(ldb < System.Math.Max(1,m)){
throw new ArgumentException("lda must be at least max(1,m).","ldb");
}
}
示例4: Person
public Person(int helthPoint, int x, int y, Side team)
{
this.HelthPoint = helthPoint;
this.x = x;
this.y = y;
this.Team = team;
}
示例5: WaitForPosition
private IEnumerator WaitForPosition()
{
yield return new WaitForEndOfFrame();
int dir = 1;
lastSide = Side.Right;
Vector3 viewportPosition = Camera.main.WorldToViewportPoint (transform.position);
if((viewportPosition.x < 0 && viewportPosition.y > 0.5f) ||
(viewportPosition.x > 1 && viewportPosition.y < 0.5f) ||
(viewportPosition.y < 0 && viewportPosition.x < 0.5f) ||
(viewportPosition.y > 1 && viewportPosition.x > 0.5f))
{
dir = -1;
lastSide = Side.Left;
}
sideVelocity = (Vector2)transform.up * dir;
frontVelocity = (Vector2)transform.right;
finalVelocity = (frontVelocity + sideVelocity).normalized;
myAnimator.SetInteger ("State", (lastSide == Side.Right) ? 0 : 1);
yield return new WaitForEndOfFrame();
myAnimator.SetInteger("State", 2);
angle = Mathf.Atan2 (finalVelocity.y, finalVelocity.x) * Mathf.Rad2Deg;
StartCoroutine (ChangeDirection (timeToChangeDirection.Random ()));
}
示例6: Player
public Player(string name, Side side)
{
Name = name;
Side = side;
win = 0;
lose = 0;
}
示例7: AdvanceState
private void AdvanceState(Side side)
{
if (StillPlaying())
{
if (HasEnteredDeuce())
{
this.state = GameState.Deuce;
if (GetPointState(side) == PointState.Advantage)
{
this.state = DetermineWinner(side);
return;
}
if((sideOnePoints == PointState.Deuce && sideTwoPoints == PointState.Deuce)
|| (sideOnePoints == PointState.Forty && sideTwoPoints == PointState.Forty))
{
SetPointState(side, PointState.Advantage);
return;
}
sideOnePoints = PointState.Deuce;
sideTwoPoints = PointState.Deuce;
return;
}
RollPoints(side);
if (((int)GetPointState(side)) > 4)
{
this.state = DetermineWinner(side);
}
}
}
示例8:
public Slot this[Side index]
{
// access to neighby slots on the index
get {
return slot.nearSlot[index];
}
}
示例9: MoveWindowOutOfScreen
private async void MoveWindowOutOfScreen(Side side)
{
BaseWindow.Topmost = true;
MoveOut?.Invoke(this, EventArgs.Empty);
if (side == Side.Left)
{
for (var i = 0; i > -32; i--)
{
await Task.Delay(1);
BaseWindow.Left = i * 10 + WpfScreen.MostLeftX;
}
}
else
{
for (int i = 0; i < 32; i++)
{
await Task.Delay(1);
BaseWindow.Left = WpfScreen.MostRightX - BaseWindow.Width + i * 10;
}
}
_movedOut = true;
BaseWindow.ShowInTaskbar = false;
_movedOutSide = side;
StartMagic();
}
示例10: getPosition
public Position getPosition(Instrument instrument, Side orderMode)
{
IntPtr cPtr = ContextModulePINVOKE.NetPositions_getPosition(swigCPtr, Instrument.getCPtr(instrument), (int)orderMode);
Position ret = (cPtr == IntPtr.Zero) ? null : new Position(cPtr, false);
if (ContextModulePINVOKE.SWIGPendingException.Pending) throw ContextModulePINVOKE.SWIGPendingException.Retrieve();
return ret;
}
示例11: DbWords
public DbWords(int CardId, Side ListSide, WordType ListType, ParentClass parentClass)
{
id = CardId;
side = ListSide;
type = ListType;
parent = parentClass;
}
示例12: ShowSidesInfo
static void ShowSidesInfo(Side[] sides)
{
foreach (var side in sides)
{
Console.WriteLine(side.Length);
}
}
示例13: getAveragePrice
public bool getAveragePrice(MarketData md, int qty, Side side, int leg)
{
long tempPrice = 0;
long tempQty = 0;
for (int i = 0; i < 5; ++i)
{
long p = md.getPrice(side, i + 1);
long q = md.getQty(side, i + 1);
tempPrice += p * q;
tempQty += q;
if (tempQty >= qty)
break;
}
if (tempQty < qty)
{
if (leg == 1)
_data.avgPriceFirstLeg = 0;
else
_data.avgPriceSecondLeg = 0;
return false;
}
if (leg == 1)
_data.avgPriceFirstLeg = (int)(tempPrice / tempQty);
else
_data.avgPriceSecondLeg = (int)(tempPrice / tempQty);
return true;
}
示例14: Jugador
/// <summary>
/// Inicializa el Jugador a partir de su <see cref="Side"/>
/// </summary>
/// <param name="side"></param>
public Jugador(Side side)
{
//Inicializamos las variables
paddlePosition = new Point();
paddlePositionPast = new Point();
position = new Point();
this.side = side;
score = 0;
//Creamos el puntero para ver donde se encuentra la mano del jugador
mark = new Ellipse();
mark.Width = Utilities.PLAYER_ELLIPSE_RADIUS;
mark.Height = Utilities.PLAYER_ELLIPSE_RADIUS;
//Creamos la barra del jugador
shape = new Rectangle();
shape.Width = Utilities.PADDLE_WIDTH;
shape.Height = Utilities.PADDLE_HEIGHT; ;
shape.Stroke = new SolidColorBrush(Colors.White);
shape.StrokeThickness = 2;
//Coloreamos según el jugador que sea
switch (side) {
case Side.Player1:
mark.Fill = new SolidColorBrush(Utilities.PLAYER1_COLOR);
shape.Fill = new SolidColorBrush(Utilities.PLAYER1_COLOR);
break;
case Side.Player2:
mark.Fill = new SolidColorBrush(Utilities.PLAYER2_COLOR);
shape.Fill = new SolidColorBrush(Utilities.PLAYER2_COLOR);
break;
}
isConnected = false;
}
示例15: bt_right_Click
private void bt_right_Click(object sender, EventArgs e)
{
bt_left.Enabled = false;
bt_right.Enabled = false;
_Side = Side.Right;
lb_status.Text = "Press space to save right point";
}