Esempio n. 1
0
        public override GeneBase Copy()
        {
            var result = new RacerGene()
            {
                Priority = this.Priority,
                Odds     = this.Odds,
                Racer    = this.Racer
            };

            return(result);
        }
Esempio n. 2
0
        public override bool Equals(Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Point return false.
            RacerGene g = obj as RacerGene;

            if ((Object)g == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return((Priority == g.Priority) && (Odds == g.Odds) && (Racer == g.Racer));
        }