public ModifierProperty(string name, bool fraction, RelativeValue value) { Name = name; LocalID = Index++; IsFraction = fraction; RelativeValue = value; }
private string GetValueShortName() { string shortName; switch (RelativeValue) { case 10: shortName = "T"; break; case 11: shortName = "J"; break; case 12: shortName = "Q"; break; case 13: shortName = "K"; break; case 14: shortName = "A"; break; default: shortName = RelativeValue.ToString(); break; } return(shortName); }
public override int GetHashCode() { unchecked { return(Value.GetHashCode() + RelativeValue.GetHashCode() + (Currency != null ? Currency.GetHashCode() : 0) + (CurrencyConverter != null ? CurrencyConverter.GetHashCode() : 0)); } }
public static int GetValue(RelativeValue relativeValue, Vector3Int input, int min = 0, int max = int.MaxValue) { switch (relativeValue) { case RelativeValue.VarX: return(input.x); case RelativeValue.VarY: return(input.y); case RelativeValue.VarZ: return(input.z); case RelativeValue.InverseVarX: return(max - input.x); case RelativeValue.InverseVarY: return(max - input.y); case RelativeValue.InverseVarZ: return(max - input.z); case RelativeValue.Zero: return(0); case RelativeValue.Min: return(min); case RelativeValue.Max: return(max); } return(0); }
public RelativeSquare(RelativeValue width, RelativeValue height) { this.Width = width; this.Height = height; }
public Coordinate GetFromOperated(List <CommentInformation> operatedComments, CommentInformation currentComment, double videoDuration, double commentDuration, double time, ICanvas canvas, RelativeValue fontHeight) { var canvasWidth = canvas.CanvasWidth; var vpos1 = GetActualVpos(currentComment.Content.Vpos, videoDuration, commentDuration); var y = Math.Max(0, currentComment.LastY.GetActual(canvas)); var firstCollision = true; var currentWidth = currentComment.Size.Width.GetActual(canvas); for (int i = 0; i < operatedComments.Count; i++) { var operatedComment = operatedComments[i]; var vpos2 = GetActualVpos(operatedComment.Content.Vpos, videoDuration, commentDuration); var operatedWidth = operatedComment.Size.Width.GetActual(canvas); var a = GetPositionX(vpos1, vpos2 / 100.0 + commentDuration, currentWidth, canvasWidth, commentDuration); var b = GetPositionX(vpos2, vpos1 / 100.0, operatedWidth, canvasWidth, commentDuration) + operatedWidth; var c = GetPositionX(vpos2, vpos1 / 100.0 + commentDuration, operatedWidth, canvasWidth, commentDuration); var d = GetPositionX(vpos1, vpos2 / 100.0, currentWidth, canvasWidth, commentDuration) + currentWidth; if ( CheckY(y, operatedComment.LastY.GetActual(canvas), fontHeight.GetActual(canvas)) && (!(((b < canvasWidth) && (0 < a) && (vpos2 <= vpos1)) || ((c < canvasWidth) && (0 < d) && (vpos1 < vpos2)))) ) { i = -1; if (firstCollision) { firstCollision = false; y = 0; } else { y += fontHeight.GetActual(canvas); } } } var x = GetPositionX(vpos1, time, currentWidth, canvasWidth, commentDuration); return(new Coordinate(x, y)); }
/// <inheritdoc /> public override int GetHashCode() { return(RelativeValue.GetHashCode()); }
/// <inheritdoc /> public int CompareTo(Percentage other) { return(RelativeValue.CompareTo(other.RelativeValue)); }
/// <inheritdoc /> public bool Equals(Percentage other) { return(RelativeValue.Equals(other.RelativeValue)); }
public Vector3IntRel(RelativeValue x, RelativeValue y, RelativeValue z) { this.x = x; this.y = y; this.z = z; }
public int CompareTo(Card other) { return(RelativeValue.CompareTo(other.RelativeValue)); }
public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.CurrencyItem) { hash ^= CurrencyItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.StaminaItem) { hash ^= StaminaItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.DetectorItem) { hash ^= DetectorItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.ContainerItem) { hash ^= ContainerItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.RunestoneItem) { hash ^= RunestoneItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.PotionItem) { hash ^= PotionItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.PotionIngredient) { hash ^= PotionIngredient.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.EnergyItem) { hash ^= EnergyItem.GetHashCode(); } if (vaultItemTypeCase_ == VaultItemTypeOneofCase.CauldronTimeItem) { hash ^= CauldronTimeItem.GetHashCode(); } if (Cap != 0L) { hash ^= Cap.GetHashCode(); } if (RelativeValue != 0) { hash ^= RelativeValue.GetHashCode(); } if (VaultCategoryGmtId.Length != 0) { hash ^= VaultCategoryGmtId.GetHashCode(); } hash ^= (int)vaultItemTypeCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }