Exemplo n.º 1
0
        public override bool Equals(System.Object otherPony)
        {
            if (!(otherPony is Pony))
            {
                return(false);
            }
            else
            {
                Pony newPony             = otherPony as Pony;
                bool nameEquality        = (this.GetName() == newPony.GetName());
                bool typeEquality        = (this.GetPonyType() == newPony.GetPonyType());
                bool cutieMarkEquality   = (this.GetCutieMark() == newPony.GetCutieMark());
                bool productTypeEquality = (this.GetProductType() == newPony.GetProductType());
                bool allEquality;

                if (nameEquality && typeEquality && cutieMarkEquality && productTypeEquality)
                {
                    allEquality = true;
                }
                else
                {
                    allEquality = false;
                }

                return(allEquality);
            }
        }