Microsoft.Xna.Framework.Rectangle.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
		public override bool Equals (object obj)
		{
			bool result = false;
			if (obj is Rectangle)
			{
				result = this.Equals ((Rectangle)obj);
			}
			return result;
		}

Same methods

Rectangle::Equals ( Rectangle other ) : bool

Usage Example

Beispiel #1
0
        //Contructs a tower. Throws exceptions for invalid ranges of values (18 lines)
        public Tower(String name, int health, int damage, int cost, int range, Rectangle location)
        {
            if (location.Equals(new Rectangle()))
                throw new ArgumentNullException();
            if (range <= 0)
                throw new ArgumentOutOfRangeException();
            if (damage < 0)
                throw new ArgumentOutOfRangeException();
            if (health <= 0)
                throw new ArgumentOutOfRangeException();
            if (cost < 0)
                throw new ArgumentOutOfRangeException();

            this.name = name;
            this.location = location;
            this.health = health;
            this.attackDamage = damage;
            this.cost = cost;
            this.range = range;
            this.updateCounter = 0;
            this.nearbyEnemies = new List<Enemy>();

            this.color = Color.White;
            switch (name)
            {
                case "path":
                    this.color = Color.Black;
                    break;
                case "slow":
                    this.color = Color.Blue;
                    break;
                case "dot":
                    this.color = Color.Red;
                    break;
                case "sniper":
                    this.color = Color.Green;
                    break;

            }

            if (color == Color.White)
                name = "basic";
        }
All Usage Examples Of Microsoft.Xna.Framework.Rectangle::Equals