Beispiel #1
0
        public override ProgrammingElement Clone()
        {
            TeamModifier clone = new TeamModifier();

            CopyTo(clone);
            return(clone);
        }
Beispiel #2
0
        /// <summary>
        /// Figure out the name of the score register from the set of modifiers.
        /// If the name could not be determined, a default name is returned.
        /// </summary>
        public static ScoreBucket ScoreBucketFromModifierSet(List <Modifier> modifiers, ref bool specified, ref bool isColorBucket)
        {
            specified     = true;
            isColorBucket = true;

            foreach (Modifier modifier in modifiers)
            {
                if (modifier is ColorModifier)
                {
                    ColorModifier colorMod = modifier as ColorModifier;
                    return((ScoreBucket)colorMod.color);
                }

                if (modifier is ScoreBucketModifier)
                {
                    isColorBucket = false;
                    ScoreBucketModifier bucketMod = modifier as ScoreBucketModifier;
                    return(bucketMod.bucket);
                }

                // Legacy code support
                if (modifier is TeamModifier)
                {
                    TeamModifier teamMod = modifier as TeamModifier;

                    if (teamMod.team == TeamModifier.Team.B)
                    {
                        return((ScoreBucket)Classification.Colors.Green);
                    }
                    else
                    {
                        return((ScoreBucket)Classification.Colors.Red);
                    }
                }
            }

            specified = false;
            return(ScoreBucket.NotApplicable);
        }
Beispiel #3
0
 protected void CopyTo(TeamModifier clone)
 {
     base.CopyTo(clone);
     clone.team = this.team;
 }