Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if InventoryOrderStatistic instances are equal
        /// </summary>
        /// <param name="other">Instance of InventoryOrderStatistic to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InventoryOrderStatistic other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Total == other.Total ||
                     Total != null &&
                     Total.Equals(other.Total)
                 ) &&
                 (
                     Default == other.Default ||
                     Default != null &&
                     Default.Equals(other.Default)
                 ) &&
                 (
                     Missed == other.Missed ||
                     Missed != null &&
                     Missed.Equals(other.Missed)
                 ) &&
                 (
                     Broken == other.Broken ||
                     Broken != null &&
                     Broken.Equals(other.Broken)
                 ) &&
                 (
                     Active == other.Active ||
                     Active != null &&
                     Active.Equals(other.Active)
                 ) &&
                 (
                     Remaining == other.Remaining ||
                     Remaining != null &&
                     Remaining.Equals(other.Remaining)
                 ) &&
                 (
                     Research == other.Research ||
                     Research != null &&
                     Research.Equals(other.Research)
                 ) &&
                 (
                     Transferred == other.Transferred ||
                     Transferred != null &&
                     Transferred.Equals(other.Transferred)
                 ));
        }
Ejemplo n.º 2
0
        public virtual bool OnMissed()
        {
            if (Resolved)
            {
                return(false);
            }

            Missed?.Invoke(this, EventArgs.Empty);
            return(Resolved = true);
        }
Ejemplo n.º 3
0
        private static bool ContainsMissed(string Line)
        {
            if (Multithread)
            {
                return(Missed.Contains(Line));
            }

            PipeWriter.Write((byte)PipeCommands.FindMissed);
            PipeWriter.Write(Line);
            PipeWriter.Flush();
            return(PipeReader.ReadByte() == (byte)PipeCommands.True);
        }
Ejemplo n.º 4
0
        private static void AddMissed(string Line)
        {
            if (Multithread)
            {
                if (!Missed.Contains(Line))
                {
                    Missed.Add(Line);
                }
                return;
            }

            PipeWriter.Write((byte)PipeCommands.AddMissed);
            PipeWriter.Write(Line);
            PipeWriter.Flush();
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Total != null)
         {
             hashCode = hashCode * 59 + Total.GetHashCode();
         }
         if (Default != null)
         {
             hashCode = hashCode * 59 + Default.GetHashCode();
         }
         if (Missed != null)
         {
             hashCode = hashCode * 59 + Missed.GetHashCode();
         }
         if (Broken != null)
         {
             hashCode = hashCode * 59 + Broken.GetHashCode();
         }
         if (Active != null)
         {
             hashCode = hashCode * 59 + Active.GetHashCode();
         }
         if (Remaining != null)
         {
             hashCode = hashCode * 59 + Remaining.GetHashCode();
         }
         if (Research != null)
         {
             hashCode = hashCode * 59 + Research.GetHashCode();
         }
         if (Transferred != null)
         {
             hashCode = hashCode * 59 + Transferred.GetHashCode();
         }
         return(hashCode);
     }
 }
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public string ToString(string delimeter)
 {
     string[] values = new string[]
     {
         Group,
         RTTgt.ToString(),
         RTMed.ToString(),
         Found.ToString(),
         Missed.ToString(),
         ScoreMFEMax.ToString(),
         HeightMed.ToString(),
         MassAvg.ToString(),
         RTAvg.ToString(),
         MassMedian.ToString(),
         TargetMass.ToString()
     };
     return(String.Join(delimeter, values));
 }
Ejemplo n.º 7
0
    void Update()
    {
        // Check if the player has pressed the fire button and if enough time has elapsed since they last fired
        if (Input.GetButtonDown("Fire1") && Time.time > nextFire && counter < LimitShot)
        {
            // Update the time when our player can fire next
            nextFire = Time.time + fireRate;
            counter++;

            // Start our ShotEffect coroutine to turn our laser line on and off
            StartCoroutine(ShotEffect());

            // Create a vector at the center of our camera's viewport
            Vector3 rayOrigin = fpsCam.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, 0.0f));

            // Declare a raycast hit to store information about what our raycast has hit
            RaycastHit hit;

            // Set the start position for our visual effect for our laser to the position of gunEnd
            laserLine.SetPosition(0, gunEnd.position);

            // Check if our raycast has hit anything
            if (Physics.Raycast(rayOrigin, fpsCam.transform.forward, out hit, weaponRange))
            {
                // Set the end position for our laser line
                laserLine.SetPosition(1, hit.point);

                // Get a reference to a health script attached to the collider we hit

                //target 1
                ShootableBox health  = hit.collider.GetComponent <ShootableBox>();
                twoPoints    health2 = hit.collider.GetComponent <twoPoints>();
                threePoints  health3 = hit.collider.GetComponent <threePoints>();
                fourPoints   health4 = hit.collider.GetComponent <fourPoints>();
                fivePoints   health5 = hit.collider.GetComponent <fivePoints>();

                //missed bullet
                Missed health6 = hit.collider.GetComponent <Missed>();

                //target 2
                Target2PointOne   target2_point1 = hit.collider.GetComponent <Target2PointOne>();
                Target2PointTwo   target2_point2 = hit.collider.GetComponent <Target2PointTwo>();
                Target2PointThree target2_point3 = hit.collider.GetComponent <Target2PointThree>();
                Target2Point4     target2_point4 = hit.collider.GetComponent <Target2Point4>();
                Target2Point5     target2_point5 = hit.collider.GetComponent <Target2Point5>();
                //target 3
                Target3Point1 target3_point1 = hit.collider.GetComponent <Target3Point1>();
                Target3Point2 target3_point2 = hit.collider.GetComponent <Target3Point2>();
                Target3Point3 target3_point3 = hit.collider.GetComponent <Target3Point3>();
                Target3Point4 target3_point4 = hit.collider.GetComponent <Target3Point4>();
                Target3Point5 target3_point5 = hit.collider.GetComponent <Target3Point5>();

                //target 1
                // If there was a health script attached
                if (health != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    health.Damage(gunDamage);
                }
                // If there was a health script attached
                if (health2 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    health2.Damage(gunDamage);
                }
                // If there was a health script attached
                if (health3 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    health3.Damage(gunDamage);
                }
                // If there was a health script attached
                if (health4 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    health4.Damage(gunDamage);
                }
                // If there was a health script attached
                if (health5 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    health5.Damage(gunDamage);
                }

                //missed target
                // If there was a health script attached
                if (health6 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    health6.Damage(gunDamage);
                }


                // target 2
                // If there was a health script attached
                if (target2_point1 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target2_point1.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target2_point2 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target2_point2.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target2_point3 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target2_point3.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target2_point4 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target2_point4.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target2_point5 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target2_point5.Damage(gunDamage);
                }

                //target 3
                // If there was a health script attached
                if (target3_point1 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target3_point1.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target3_point2 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target3_point2.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target3_point3 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target3_point3.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target3_point4 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target3_point4.Damage(gunDamage);
                }

                // If there was a health script attached
                if (target3_point5 != null)
                {
                    // Call the damage function of that script, passing in our gunDamage variable
                    target3_point5.Damage(gunDamage);
                }
                // Check if the object we hit has a rigidbody attached
                if (hit.rigidbody != null)
                {
                    // Add force to the rigidbody we hit, in the direction from which it was hit
                    hit.rigidbody.AddForce(-hit.normal * hitForce);
                }
            }
            else
            {
                // If we did not hit anything, set the end of the line to a position directly in front of the camera at the distance of weaponRange
                laserLine.SetPosition(1, rayOrigin + (fpsCam.transform.forward * weaponRange));
            }
        }
    }
Ejemplo n.º 8
0
 private void OnMissed()
 {
     Missed?.Invoke(this, new EventArgs());
 }
Ejemplo n.º 9
0
 private void OnMissed()
 {
     Missed?.Invoke(this, new MissedEventArgs(_model.MissesLeft));
 }