Exemple #1
0
        /// <summary>
        /// Tests if a given nadeevent is the ended event of this nadeevent. this just confirms the categorie not that it is indeed the corresponding event.
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public bool IsEndEventOf(NadeEvents n)
        {
            switch (this.GameeventType)
            {
            case "smoke_exploded":
                return(n.GameeventType == "smoke_ended");

            case "fire_exploded":
                return(n.GameeventType == "firenade_ended");

            case "decoy_exploded":
                return(n.GameeventType == "decoy_ended");

            default:
                return(false);
            }
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            NadeEvents other = obj as NadeEvents;

            if (other == null)
            {
                return(false);
            }

            if (this.IsEndEventOf(other) && this.Actor.Equals(other.Actor) && this.nadetype == other.nadetype)
            {
                var dx = Math.Abs(other.position.X - this.position.X);
                var dy = Math.Abs(other.position.Y - this.position.Y);
                if (dx < 10 && dy < 10) // 10 units tolerance to confirm the nade
                {
                    return(true);
                }
            }
            return(false);
        }