public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is Dispute other && ((DisputeId == null && other.DisputeId == null) || (DisputeId?.Equals(other.DisputeId) == true)) && ((AmountMoney == null && other.AmountMoney == null) || (AmountMoney?.Equals(other.AmountMoney) == true)) && ((Reason == null && other.Reason == null) || (Reason?.Equals(other.Reason) == true)) && ((State == null && other.State == null) || (State?.Equals(other.State) == true)) && ((DueAt == null && other.DueAt == null) || (DueAt?.Equals(other.DueAt) == true)) && ((DisputedPayment == null && other.DisputedPayment == null) || (DisputedPayment?.Equals(other.DisputedPayment) == true)) && ((EvidenceIds == null && other.EvidenceIds == null) || (EvidenceIds?.Equals(other.EvidenceIds) == true)) && ((CardBrand == null && other.CardBrand == null) || (CardBrand?.Equals(other.CardBrand) == true)) && ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) && ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)) && ((BrandDisputeId == null && other.BrandDisputeId == null) || (BrandDisputeId?.Equals(other.BrandDisputeId) == true)) && ((ReportedDate == null && other.ReportedDate == null) || (ReportedDate?.Equals(other.ReportedDate) == true)) && ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) && ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true))); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is CashDrawerShift other && ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && ((State == null && other.State == null) || (State?.Equals(other.State) == true)) && ((OpenedAt == null && other.OpenedAt == null) || (OpenedAt?.Equals(other.OpenedAt) == true)) && ((EndedAt == null && other.EndedAt == null) || (EndedAt?.Equals(other.EndedAt) == true)) && ((ClosedAt == null && other.ClosedAt == null) || (ClosedAt?.Equals(other.ClosedAt) == true)) && ((EmployeeIds == null && other.EmployeeIds == null) || (EmployeeIds?.Equals(other.EmployeeIds) == true)) && ((OpeningEmployeeId == null && other.OpeningEmployeeId == null) || (OpeningEmployeeId?.Equals(other.OpeningEmployeeId) == true)) && ((EndingEmployeeId == null && other.EndingEmployeeId == null) || (EndingEmployeeId?.Equals(other.EndingEmployeeId) == true)) && ((ClosingEmployeeId == null && other.ClosingEmployeeId == null) || (ClosingEmployeeId?.Equals(other.ClosingEmployeeId) == true)) && ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) && ((OpenedCashMoney == null && other.OpenedCashMoney == null) || (OpenedCashMoney?.Equals(other.OpenedCashMoney) == true)) && ((CashPaymentMoney == null && other.CashPaymentMoney == null) || (CashPaymentMoney?.Equals(other.CashPaymentMoney) == true)) && ((CashRefundsMoney == null && other.CashRefundsMoney == null) || (CashRefundsMoney?.Equals(other.CashRefundsMoney) == true)) && ((CashPaidInMoney == null && other.CashPaidInMoney == null) || (CashPaidInMoney?.Equals(other.CashPaidInMoney) == true)) && ((CashPaidOutMoney == null && other.CashPaidOutMoney == null) || (CashPaidOutMoney?.Equals(other.CashPaidOutMoney) == true)) && ((ExpectedCashMoney == null && other.ExpectedCashMoney == null) || (ExpectedCashMoney?.Equals(other.ExpectedCashMoney) == true)) && ((ClosedCashMoney == null && other.ClosedCashMoney == null) || (ClosedCashMoney?.Equals(other.ClosedCashMoney) == true)) && ((Device == null && other.Device == null) || (Device?.Equals(other.Device) == true))); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is InventoryTransfer other && ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && ((ReferenceId == null && other.ReferenceId == null) || (ReferenceId?.Equals(other.ReferenceId) == true)) && ((State == null && other.State == null) || (State?.Equals(other.State) == true)) && ((FromLocationId == null && other.FromLocationId == null) || (FromLocationId?.Equals(other.FromLocationId) == true)) && ((ToLocationId == null && other.ToLocationId == null) || (ToLocationId?.Equals(other.ToLocationId) == true)) && ((CatalogObjectId == null && other.CatalogObjectId == null) || (CatalogObjectId?.Equals(other.CatalogObjectId) == true)) && ((CatalogObjectType == null && other.CatalogObjectType == null) || (CatalogObjectType?.Equals(other.CatalogObjectType) == true)) && ((Quantity == null && other.Quantity == null) || (Quantity?.Equals(other.Quantity) == true)) && ((OccurredAt == null && other.OccurredAt == null) || (OccurredAt?.Equals(other.OccurredAt) == true)) && ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) && ((Source == null && other.Source == null) || (Source?.Equals(other.Source) == true)) && ((EmployeeId == null && other.EmployeeId == null) || (EmployeeId?.Equals(other.EmployeeId) == true))); }
private void sequenceCompleted(State state) { if (state?.Equals(null) ?? true) { return; } foreach (GameObject target in state.Targets) { if (!target.IsDestroyed()) { PenguinUserControl component = target.GetComponent <PenguinUserControl>(); if (component != null) { component.enabled = true; } Animator component2 = target.GetComponent <Animator>(); if (component2 != null) { component2.SetBool(AnimationHashes.Params.Scripted, value: false); } } } if (state.Owner != null && state.Owner.CompareTag("Player")) { Service.Get <EventDispatcher>().DispatchEvent(default(ActionSequencerEvents.ActionSequenceCompleted)); } if (state.Owner != null && !state.Owner.Equals(null) && this.SequenceCompleted != null && this.SequenceCompleted.Target != null && !this.SequenceCompleted.Target.Equals(null)) { this.SequenceCompleted(state.Owner); } }
private bool Diff(LiveThread compare) { return(!(Id.Equals(compare.Id) && Description.Equals(compare.Description) && NSFW.Equals(compare.NSFW) && Resources.Equals(compare.Resources) && TotalViews.Equals(compare.TotalViews) && Created.Equals(compare.Created) && Fullname.Equals(compare.Fullname) && IsAnnouncement.Equals(compare.IsAnnouncement) && AnnouncementURL.Equals(compare.AnnouncementURL) && State.Equals(compare.State) && ViewerCount.Equals(compare.ViewerCount) && Icon.Equals(compare.Icon))); }
public void RecoverOvertime() { if (m_minimumHealthPercentage < HealthPercentage && State.Equals(ActorState.DEFAULT)) { m_healthPercentage -= HEAL_RECOVER_TICK; // Headge value if it overflows m_healthPercentage = m_healthPercentage < 0 ? 0 : m_healthPercentage; } if (0 < StunTime && State.Equals(ActorState.DEFAULT) && HealthPercentage <= 50) { m_stunTime -= STUN_RECOVER_TICK; // Headge value if it overflows m_stunTime = m_stunTime < 0 ? 0 : m_stunTime; } }
/// <summary> /// Update machine's state. /// </summary> public async Task UpdateAsync(TInput input) { TState oldState = State; if (Nodes.TryGetValue(State, out var node)) { State = await node.TransitAsync(input).ConfigureAwait(false); } if (!State.Equals(oldState)) { await ProcessExit(oldState, input, State).ConfigureAwait(false); await ProcessEntry(oldState, input, State).ConfigureAwait(false); } }
public Boolean IsAvailable(int diceRoll) { bool available = false; if (State.Equals(PieceState.Home) && diceRoll == 6) { available = true; } else if ((State.Equals(PieceState.Playing) || State.Equals(PieceState.Safe)) && Position + diceRoll <= Game.BOARD_MOVES + Game.HOME_SPACES) { available = true; } return(available); }
private void ChangeViewModel(State state, object obj = null) { if (!PageViewModels.Keys.Contains(state)) { throw new ArgumentException(); } if (state.Equals(State.DisplayScreen)) { CurrentPageViewModel = new DisplayScreenViewModel(obj as Bitmap); return; } CurrentPageViewModel = PageViewModels[state]; }
/// <summary> /// Returns true if Address instances are equal /// </summary> /// <param name="other">Instance of Address to be compared</param> /// <returns>Boolean</returns> public bool Equals(Address other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ID == other.ID || ID != null && ID.Equals(other.ID) ) && ( VendorID == other.VendorID || VendorID != null && VendorID.Equals(other.VendorID) ) && ( Street == other.Street || Street != null && Street.Equals(other.Street) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( State == other.State || State != null && State.Equals(other.State) ) && ( Country == other.Country || Country != null && Country.Equals(other.Country) ) && ( ZipCode == other.ZipCode || ZipCode != null && ZipCode.Equals(other.ZipCode) )); }
/// <summary> /// Returns true if Deposit instances are equal /// </summary> /// <param name="other">Instance of Deposit to be compared</param> /// <returns>Boolean</returns> public bool Equals(Deposit other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( UpdatedTimestamp == other.UpdatedTimestamp || UpdatedTimestamp != null && UpdatedTimestamp.Equals(other.UpdatedTimestamp) ) && ( State == other.State || State.Equals(other.State) ) && ( ReceivedTimestamp == other.ReceivedTimestamp || ReceivedTimestamp != null && ReceivedTimestamp.Equals(other.ReceivedTimestamp) ) && ( Currency == other.Currency || Currency.Equals(other.Currency) ) && ( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( TransactionId == other.TransactionId || TransactionId != null && TransactionId.Equals(other.TransactionId) )); }
protected override void OnMouseEnter(EventArgs e) { if (!showSplit) { base.OnMouseEnter(e); return; } if (!State.Equals(PushButtonState.Pressed) && !State.Equals(PushButtonState.Disabled)) { State = PushButtonState.Hot; } }
public ChangeRequestState EvaluateState(string method) { if (method.Equals("delete", StringComparison.OrdinalIgnoreCase) || (IsSystem && State.Equals(ChangeRequestPhase.Declined, StringComparison.OrdinalIgnoreCase))) { return(ChangeRequestState.RequestCancelled); } else if (IsManager) { return(IsApproved ? ChangeRequestState.ManagerApproved : ChangeRequestState.ManagerDeclined); } return(ChangeRequestState.ManagerPending); }
/// <summary> /// Wait for state. /// </summary> /// <param name="state">State to wait</param> /// <param name="timeOut_ms">Timeout</param> /// <param name="pollInterval_ms">Poll interval</param> /// <returns>Returns true if state was reached before timeout.</returns> public bool TryWaitState(string state, int timeOut_ms = 5000, int pollInterval_ms = 100) { var sw = new Stopwatch(); sw.Start(); while (!State.Equals(state)) { if (sw.ElapsedMilliseconds > timeOut_ms) { return(false); } Thread.Sleep(pollInterval_ms); } return(true); }
public override bool Equals(object obj) { if (obj is MDPState) { SystemState state = ((MDPState)obj).State; if (state == null || state.Diagnoses == null || State.Diagnoses == null) { return(false); } return(State.Equals(state)); } else { return(base.Equals(obj)); } }
public void Jump() { if (Rigidbody != null && CanJump && State.Equals(ActorState.DEFAULT)) { m_canJump = false; if (!Grounded) { Rigidbody.velocity = Vector3.zero; } float jump = JUMP_POWER; Rigidbody.AddForce((jump * Vector3.up), ForceMode.Impulse); EffectManager.GroundContact(); //So we aren't grounded at take off m_groundCheckDistance = GROUND_CHECK_MIN; } }
protected override void OnGotFocus(EventArgs e) { if (!showSplit) { base.OnGotFocus(e); return; } if (!State.Equals(PushButtonState.Pressed) && !State.Equals(PushButtonState.Disabled)) { State = PushButtonState.Default; } }
IEnumerator ColorExtractingCoroutine(State state) { if (state.Equals(State.Found)) { positionsForPoints = new List <Vector3[]>(objectsAR.Count); print(positionsForPoints.Count + " positionsForPoints.Count"); yield return(new WaitForSeconds(waitToCheckPoint)); screenTexture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false); yield return(new WaitForEndOfFrame()); screenTexture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0); screenTexture.Apply(); print(objectsAR.Count); for (int i = 0; i < objectsAR.Count; i++) { print(i); positionsForPoints.Add(new Vector3[amountOfChecks]); } for (int i = 0; i < amountOfChecks; i++) { for (int j = 0; j < objectsAR.Count; j++) { positionsForPoints[j][i] = objectsAR[j].rootTransform.position; } yield return(new WaitForSeconds(timeBetweenChecks)); } for (int i = 0; i < objectsAR.Count; i++) { objectsAR[i].CheckIfBusy(screenTexture, positionsForPoints[i]); } SetOuterRigActive(true); SpawnMouse(); } else { foreach (SceneObjectAR objectAR in objectsAR) { objectAR.Disable(); } SetOuterRigActive(false); } }
void ProcessInput() { // si su estado es vivo, puede hacer todo eso, si esta muerto no if (state.Equals(State.Alive)) { ResponderAEmpuje(); ResponderARotacion(); } if (state == State.Dying) { } //entrar en modo depuracion if (Debug.isDebugBuild) { entrarEnModoDepuracion(); } }
public virtual bool ShouldMerge(Site otherSite) { if (!Name.Equals(otherSite.Name, StringComparison.OrdinalIgnoreCase)) { return(false); } if (!State.Equals(otherSite.State) || !County.Equals(otherSite.County, StringComparison.OrdinalIgnoreCase)) { return(false); } if (CalculatedCoordinates.CalculateDistanceInMinutesTo(otherSite.CalculatedCoordinates) > CoordinateMinutesEquivalenceProximity) { return(false); } return(true); }
private void HandleStun() { if (State.Equals(ActorState.STUNNED) || State.Equals(ActorState.DOWN)) { if (StunTime <= 0) { UpdateState(ActorState.DEFAULT); m_stunTime = 0; Rigidbody.velocity = new Vector2(0, Rigidbody.velocity.y); m_canGetUp = false; } else { m_stunTime -= Time.deltaTime; } } }
public IEnumerator IgnoreCollision(Collider col) { Physics.IgnoreCollision(Collider, col, true); // Re-enable collision when collision is the width of the collider away OR if attacking yield return(new WaitUntil( () => Vector3.Distance(transform.position, col.transform.position) > Collider.height || State.Equals(ActorState.ATTACKING) )); Actor actor = col.gameObject.GetComponent <Actor>(); if (Collider != null) { Physics.IgnoreCollision(Collider, actor.Collider, false); } }
public override bool Equals(object obj) { bool isSame = false; var newAddress = obj as Address; if (Line1.Equals(newAddress.Line1, StringComparison.OrdinalIgnoreCase) && (Line2 ?? "").Equals((newAddress.Line2 ?? ""), StringComparison.OrdinalIgnoreCase) && (Line3 ?? "").Equals((newAddress.Line3 ?? ""), StringComparison.OrdinalIgnoreCase) && City.Equals(newAddress.City, StringComparison.OrdinalIgnoreCase) && State.Equals(newAddress.State, StringComparison.OrdinalIgnoreCase) && Country.Equals(newAddress.Country, StringComparison.OrdinalIgnoreCase) && PostalCode.Equals(newAddress.PostalCode, StringComparison.OrdinalIgnoreCase)) { isSame = true; } return(isSame); }
public double ComputeTax(IEnumerable <ShoppingCartQuantityProduct> productQuantities, double subtotal, double shippingCost, string country, string zipCode) { var tax = (subtotal + shippingCost) * Rate; var state = UnitedStates.State(zipCode); var sameState = String.IsNullOrWhiteSpace(State) || State == "*" || State != null && State.Equals(state ?? "", StringComparison.CurrentCultureIgnoreCase); var sameCountry = !String.IsNullOrWhiteSpace(Country) && (Country == "*" || Country.Equals(country, StringComparison.CurrentCultureIgnoreCase)); if (sameState && sameCountry) { return(tax); } return(0); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "WindowBorder") { if (state.Equals(State.dirty)) { player.GetComponent <PlayerController>().DecreaseScore(scoreToDecrease); // TODO: Show feedback decreased score } Destroy(this.gameObject); } if (collision.gameObject.tag == "Player") { player.GetComponent <PlayerController>().SetNumToCleanWindow(numToClean); } }
private void OnTriggerStay(Collider other) { if (!isDead) { if (other.CompareTag("Player")) { Damaged(1.0f); } else if (other.CompareTag("Barrier")) { if (!State.Equals("Blocked")) { StartCoroutine(Blocked((float)other.GetComponent <Rigidbody>().velocity.magnitude)); } } } }
private void OnTriggerStay(Collider other) { if (!isDead) { if (other.CompareTag("Player")) { Damaged(1.0f); } else if (other.CompareTag("Barrier")) { if (!State.Equals("Blocked")) { StartCoroutine(Blocked()); } } } }
private void BtnOK_Click(object sender, RoutedEventArgs e) { if (_state.Equals(State.Setting)) { ImageCtrl.Visibility = Visibility.Visible; SettingCtrl.Hide(); //Download now ImageCtrl.InitializeParameter(SettingCtrl.SettingInstant, this); _downloadThread = ImageCtrl.AsyncDownload(); StateSwitch(State.Busy); AsyncWaiting(true); } else { ImageCtrl.SetWallpaper(); } }
public override bool Equals(object obj) { var item = obj as Connection; if (item == null) { return(false); } return(OwnerPid.Equals(item.OwnerPid) && ExternalPort.Equals(item.ExternalPort) && LocalPort.Equals(item.LocalPort) && ExternalAddress.Equals(item.ExternalAddress) && LocalAddress.Equals(item.LocalAddress) && Protocol.Equals(item.Protocol) && State.Equals(item.State)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(State) && !string.IsNullOrEmpty(ProcessID)) { if (State.Equals("edit", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(NodeID)) { BindData(); } } else { return; } } }
void SetState(State s) { if (s.Equals (State.Move)) { anim.SetBool ("moving", true); } else { anim.SetBool("moving", false); } if (s.Equals (State.Climb)) { anim.SetBool ("climb", true); } else { anim.SetBool("climb", false); } state = s; }
public void State_Equals_BothCodedSameCode_SameNames_True() { var s1 = new State<StubStateModel>("state", 4); var s2 = new State<StubStateModel>("state", 4); Assert.True(s1.Equals(s2)); }
private void setState(State state) { m_state = state; Boolean viewState = m_state.Equals(State.View); guiAddBtn.Enabled = viewState; guiDeleteBtn.Enabled = viewState; guiSaveBtn.Enabled = !viewState; guiCancelBtn.Enabled = !viewState; guiEditBtn.Enabled = viewState; guiSearchBtn.Enabled = viewState; guiSearchTxt.Enabled = viewState; }
public void State_Equals_OneCodedOneUncoded_SameName_True() { var s1 = new State<StubStateModel>("state", 4); var s2 = new State<StubStateModel>("state"); Assert.True(s1.Equals(s2)); }
public void State_Equals_OneCodedOneUncoded_DiffName_False() { var s1 = new State<StubStateModel>("state", 4); var s2 = new State<StubStateModel>("state1"); Assert.False(s1.Equals(s2)); }
public void State_Equals_BothCodedSameCode_DiffNames_False() { var s1 = new State<StubStateModel>("state", 4); var s2 = new State<StubStateModel>("state1", 4); Assert.False(s1.Equals(s2)); }
// allows more control over changing state void setState(State s) { if (s.Equals(state)) return; print(state.ToString()+" -> "+s.ToString()); // previous state switch (state) { case State.Dead: return; // stay dead forever! case State.Hiding: animator.SetInteger ("ShutEyes", 0); break; case State.TimeTraveling: rb.gravityScale = defaultGravityScale; break; case State.Standard: break; } // next state switch (s) { case State.Dead: rb.gravityScale = 0; rb.velocity = Vector2.zero; random = Random.Range(1, 2); animator.SetInteger ("Dead", random); break; case State.Hiding: random = Random.Range(1, 5); animator.SetInteger ("ShutEyes", random); break; case State.TimeTraveling: rb.gravityScale = 0; rb.velocity = Vector2.zero; break; case State.Standard: rb.gravityScale = defaultGravityScale; break; } state = s; }
public void State_Equals_NeitherCoded_DiffName_False() { var s1 = new State<StubStateModel>("state"); var s2 = new State<StubStateModel>("state2"); Assert.False(s1.Equals(s2)); }