public void Provided_ZeroFeet_And_ZeroFeet_Should_Return_True() { Feet first_value = new Feet(0.0); Feet second_value = new Feet(0.0); Assert.IsTrue(first_value.ValueInFeet.Equals(second_value.ValueInFeet)); }
public void Provided_Equal_Value_Shuold_Return_True() { Feet first_value = new Feet(); first_value.ValueInFeet = 4.6; Assert.IsTrue(first_value.Equals(first_value)); }
public void Reference_Check_Test_For_Feet() { Feet first_value = new Feet(); Feet second_value = new Feet(); Assert.IsFalse(first_value.Equals(second_value)); }
public void Provided_Improper_Type_Object_Should_Return_False() { Feet first_value = new Feet(); object second_value = new object(); Assert.IsFalse(first_value.Equals(second_value)); }
void Start() { inventory = Feet.instance; inventory.onItemChanhgedCallback += UpdateUI; slots = itemsParent.GetComponentsInChildren <ShopSlot>(); }
/// <summary> /// Method for convertinf yard value to feet /// </summary> /// <param name="yard"></param> /// <returns></returns> public Feet YardToFeetConverter(Yard yard) { var yardToFeet = yard.GetValue() * 3; var feetValue = new Feet(yardToFeet); return(feetValue); }
public void When_converting_feet_Then_works(decimal distanceValue, Type type, decimal expected, decimal within) { var distance = new Feet(distanceValue); var actual = distance.ConvertTo(type); Assert.That(actual.Value, Is.EqualTo(expected).Within(within)); }
/// <summary> /// Method for converting inch to feet value /// </summary> /// <param name="inch"></param> /// <returns></returns> public Feet InchToFeetConverter(Inches inch) { var inchValue = inch.GetValue() / 12; Feet feet = new Feet(inchValue); return(feet); }
/// <summary> /// Method for converting feet into inch /// </summary> /// <param name="feet"></param> /// <returns></returns> public Inches FeetToInchConverter(Feet feet) { var feetToInchValue = feet.GetValue() * 12; Inches inchValue = new Inches(feetToInchValue); return(inchValue); }
// Start is called before the first frame update public virtual void Start() { rigidbody = GetComponent <Rigidbody2D>(); feet = GetComponentInChildren <Feet>(); animator = GetComponent <Animator>(); stats = GetComponent <CharacterStats>(); }
public void SetActivator(Feet activatorFeet) { if (activatorFeet != null) { if (isFirstLink) { if (activator == null) { activator = activatorFeet; currentState.Value = LinkState.Passed; isCurrentAndActivated.Value = true; } else if (activator == activatorFeet) { isCurrentAndActivated.Value = true; } } else { if (activator == activatorFeet) { currentState.Value = LinkState.Passed; isCurrentAndActivated.Value = true; } } } else { if (currentState == (int)LinkState.Passed) { isCurrentAndActivated.Value = false; } } }
public void Convert_Meters_and_Feet() { double m_ft = new Meters(100).To <Feet>(); // 328.083 double ft_m = new Feet(30).To <Meters>(); // 9.144 Assert.AreEqual(328.084, Math.Round(m_ft, 3)); Assert.AreEqual(9.144, Math.Round(ft_m, 3)); }
// Start is called before the first frame update void Start() { myRigidbody = GetComponent <Rigidbody2D>(); myAnimatior = GetComponent <Animator>(); myBodyCollider = GetComponent <CapsuleCollider2D>(); myFeet = GetComponentInChildren <Feet>(); mySprite = GetComponentInChildren <SpriteRenderer>(); }
public void Convert_Meters_and_Feet() { double m_ft = new Meters(100).To<Feet>(); // 328.083 double ft_m = new Feet(30).To<Meters>(); // 9.144 Assert.AreEqual(328.084, Math.Round(m_ft, 3)); Assert.AreEqual(9.144, Math.Round(ft_m, 3)); }
public static KnockAction Create(ContextValue value, Feet radius) { var k = Helpers.Create <KnockAction>(); k.Amount = value; k.Radius = radius; return(k); }
private void OnDestroy() { if (feetEnabled) { Feet feet = GetComponent <Feet>(); feet.IsOnGround.AddValueListener <bool>(OnFeetTouchGround); } }
public void Awake() { if (instance != null) { Debug.LogWarning("More than one instance of Inventory found!"); return; } instance = this; }
/// <summary> /// On awake, initialize variables. /// </summary> protected void Awake() { currentLadderList = new List <Ladder>(); myBody = GetComponent <Rigidbody2D>(); feet = GetComponentInChildren <Feet>(); Debug.Assert(myBody != null); Debug.Assert(feet != null); }
public MainCharacter(Color color) { mColor = color; mData = new MainCharacterData(); String folderColor = ""; if (mColor == Color.Blue) { folderColor = "blue"; } if (mColor == Color.Green) { folderColor = "green"; } if (mColor == Color.Red) { folderColor = "red"; } int width = 200; int height = 200; mSpriteStopped = new Sprite(ExtraFunctions.fillArrayWithImages2(1, "gameplay\\maincharacter\\" + folderColor + "\\body"), new int[] { 0 }, 7, width, height, false, false); mSpriteTopLeft = new Sprite(ExtraFunctions.fillArrayWithImages2(50, 4, "gameplay\\maincharacter\\" + folderColor + "\\body"), new int[] { 0, 1, 2, 3 }, 2, width, height, true, false); mSpriteTopRight = new Sprite(ExtraFunctions.fillArrayWithImages2(17, 5, "gameplay\\maincharacter\\" + folderColor + "\\body"), new int[] { 0, 1, 2, 3, 4 }, 2, width, height, true, false); mSpriteDownLeft = new Sprite(ExtraFunctions.fillArrayWithImages2(54, 4, "gameplay\\maincharacter\\" + folderColor + "\\body"), new int[] { 0, 1, 2, 3 }, 2, width, height, true, false); mSpriteDownRight = new Sprite(ExtraFunctions.fillArrayWithImages2(22, 4, "gameplay\\maincharacter\\" + folderColor + "\\body"), new int[] { 0, 1, 2, 3 }, 2, width, height, true, false); mSpriteVictory = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 80, "gameplay\\maincharacter\\" + folderColor + "\\win\\" + folderColor + "_win"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 80 }, 1, width, height, true, false); mSpriteDefeat = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 89, "gameplay\\maincharacter\\" + folderColor + "\\loose\\lose"), new int[] { Sprite.sALL_FRAMES_IN_ORDER, 89 }, 1, width, height, true, false); mSpriteInverseTopLeft = new Sprite(ExtraFunctions.fillArrayWithImages2(50, 4, "gameplay\\maincharacter\\" + folderColor + "\\body"), new int[] { 3, 2 }, 2, width, height, true, false); mSpriteInverseTopRight = new Sprite(ExtraFunctions.fillArrayWithImages2(17, 5, "gameplay\\maincharacter\\" + folderColor + "\\body"), new int[] { 4, 3 }, 2, width, height, true, false); addSprite(mSpriteStopped, sSTATE_STOPPED); addSprite(mSpriteTopLeft, sSTATE_TOP_LEFT); addSprite(mSpriteTopRight, sSTATE_TOP_RIGHT); addSprite(mSpriteDownLeft, sSTATE_BOTTOM_LEFT); addSprite(mSpriteDownRight, sSTATE_BOTTOM_RIGHT); addSprite(mSpriteVictory, sSTATE_VICTORY); addSprite(mSpriteDefeat, sSTATE_LOSE); addSprite(mSpriteInverseTopLeft, sSTATE_INVERSE_TOP_LEFT); addSprite(mSpriteInverseTopRight, sSTATE_INVERSE_TOP_RIGHT); changeToSprite(sSTATE_STOPPED); setCollisionRect(70, 75, 70, 90); mFeet = new Feet(color); //hurt(); }
int IComparable.CompareTo(object obj) { Distance other = obj as Distance; if (other == null) { throw new NotImplementedException(); } return(Feet.CompareTo(other.Feet)); }
private void Awake() { walker = body.GetComponent <Walker>(); jumper = body.GetComponent <Jumper>(); feet = body.GetComponent <Feet>(); propeller = body.GetComponent <Propeller>(); stick = body.GetComponent <StickToSurface>(); playerGO = GameObject.FindWithTag(followTag); }
public static FakeTargetsAround Create(Feet radius, TargetType targetType = TargetType.Any, Feet spreadSpeed = default, bool toCaster = false) { var f = Helpers.Create <FakeTargetsAround>(); f.AoERadius = radius; f.Targets = targetType; f.SpreadSpeed = spreadSpeed; f.TargetCaster = toCaster; return(f); }
/// <summary> /// On awake, initialize variables. /// </summary> protected void Awake() { Debug.Assert(jumpSpeed >= 0); audioSource = Camera.main.GetComponent <AudioSource>(); myBody = GetComponent <Rigidbody2D>(); feet = GetComponent <Feet>(); Debug.Assert(myBody != null); Debug.Assert(feet != null); }
protected override void OnChainFailed() { base.OnChainFailed(); listenToCollision = false; sr.color = Color.red; if (activator != null) { activator.IsOnGround.RemoveValueListener <bool>(OnActivatorTouchesGround); activator = null; } }
/// <summary> /// Initialize variables. /// </summary> protected void Awake() { Debug.Assert(movementSpeed > 0); Debug.Assert(rotationLerpSpeed >= 0); myBody = GetComponent <Rigidbody2D>(); feet = GetComponentInChildren <Feet>(); isGoingRight = Vector2.Dot(Vector2.right, transform.right) > 0; Debug.Assert(myBody != null); Debug.Assert(feet != null); }
private void Start() { sacoAudio.volume *= Globals.SOUND_GENERAL_SLIDER; this.transform.rotation.SetLookRotation(new Vector3(0, 0, 1)); //gets de script sound audioPlay = GetComponent <ScriptSound>(); m_throwArc.SetActive(false); m_Crosshair.SetActive(false); m_Camera = Camera.main; oS_Camera = oS_CameraGo.GetComponent <Camera>(); oS_CameraGo.SetActive(false); //animation anim = GetComponent <Control_Anim>(); //Gets the Feet Script from the feet child feetScript = feetCollider.GetComponent <Feet>(); //Making sure the secondary camera is off hideCameraRef.SetActive(false); //player rigidBody rb = this.GetComponent <Rigidbody>(); if (playerCamera == null) { playerCamera = Camera.main.gameObject; } // get the transform of the main camera if (Camera.main != null) { m_Cam = Camera.main.transform; } // get the third person character ( this should never be null due to require component ) m_Character = GetComponent <ThirdPersonCharacter>(); m_soundManager = GameObject.FindWithTag("GameController").GetComponent <SoundManager>(); interactionScript = playerInteractionZone.GetComponent <InteractionZone>(); if (m_AudioSource == null) { m_AudioSource = this.GetComponent <AudioSource>(); } m_AudioSource.volume *= Globals.SOUND_FX_SLIDER; }
public void Correctly_Add_Distances_of_Different_Types() { // These two values are equivalent, // Therefore the result should be double the meters Meters meters = 5.1954; Feet feet = 17.0452756; var expected = 10.3908; var result = meters + feet; Assert.IsTrue(expected == Math.Round(result, 4)); Assert.IsTrue(result.GetType() == typeof(Meters)); // check that type returned is Meters (base unit) }
public IActionResult FeetToInchCoverter(Feet value) { var inchValue = _quantityMeasurementManager.FeetToInchConverter(value); if (inchValue != null) { return(this.Ok(inchValue.GetValue())); } else { return(this.BadRequest()); } }
void Awake() { feet = GetComponentInChildren<Feet>(); legs = GetComponentsInChildren<Leg>(); rbody = GetComponent<Rigidbody2D>(); face = GetComponentInChildren<Face>(); hat = GetComponentInChildren<Hat>(); _audio = GetComponent<AudioClipPlayer>(); _collider = GetComponent<CapsuleCollider2D>(); squishHitbox = GetComponentInChildren<SquishHitbox>(); achievementMgr = GetComponent<PlayerAchievementMgr>(); _transform = transform; }
// Start is called before the first frame update new void Start() { base.Start(); killable.OnDeath += Killable_OnDeath; killable.OnDamage += Killable_OnDamage; navigator = GetComponent <NavMeshAgent>(); collider = GetComponent <CapsuleCollider>(); feet = GetComponent <Feet>(); isAttacking = false; navigatorDisabled = false; }
private void OnCollisionExit2D(Collision2D collision) { if (listenToCollision) { Feet leaving = null; if (collision.collider != null) { leaving = collision.collider.GetComponent <Feet>(); } if (leaving != null && leaving == activator) { SetActivator(null); } } }