public ConnectFourPattern GetPattern(ConnectFourPattern pattern)
        {
            for (int i = 0; i < Patterns.Count; i++)
            {
                if (pattern == ( ConnectFourPattern )Patterns[i])
                {
                    return(( ConnectFourPattern )Patterns[i]);
                }
            }

            return(null);
        }
        public bool IsIn(ConnectFourPattern connectFourPattern)
        {
            for (int i = 0; i < Patterns.Count; i++)
            {
                if ((( BasicGamePattern )Patterns[i]) == connectFourPattern)
                {
                    return(true);
                }
            }

            return(false);
        }
        public void UpdatePattern(ConnectFourPattern pattern)
        {
            ConnectFourPatternCollection collection = ( ConnectFourPatternCollection )GetAllPatternsWithIdentifer(pattern.GetStartsWith());

            if (collection.Count == 0)
            {
                return;
            }

            for (int i = 0; i < collection.Count; i++)
            {
                if ((( ConnectFourPattern )collection.Patterns[i]) == pattern)
                {
                    (( ConnectFourPattern )collection.Patterns[i]).UpdatePattern(pattern);
                }
            }
        }
        public override void Load(System.Xml.XmlReader xmlReader)
        {
            bool bBreak = false;

            for ( ;;)
            {
                xmlReader.Read();
                if (xmlReader.EOF == true)
                {
                    return;
                }
                switch (xmlReader.NodeType)
                {
                case XmlNodeType.Element:
                {
                    switch (xmlReader.Name)
                    {
                    case "ConnectFourPattern":
                    {
                        ConnectFourPattern temp = new ConnectFourPattern();
                        temp.Load(xmlReader);
                        Patterns.Add(temp);
                        break;
                    }
                    }
                } break;

                case XmlNodeType.EndElement:
                {
                    switch (xmlReader.Name)
                    {
                    case "ConnectFourPatternCollection": bBreak = true; break;
                    }
                } break;
                }

                if (bBreak == true)
                {
                    break;
                }
            }
        }
        public ConnectFourPattern HighestPatternWeighting()
        {
            int nHighest = 0;
            int nWeight  = (( ConnectFourPattern )Patterns[0]).Weighting;

            ConnectFourPattern pattern = null;

            for (int i = 1; i < Patterns.Count; i++)
            {
                pattern = ( ConnectFourPattern )Patterns[i];

                if (pattern.Weighting >= nWeight)
                {
                    nHighest = i;
                    nWeight  = pattern.Weighting;
                }
            }

            return(( ConnectFourPattern )Patterns[nHighest]);
        }
 public void AddPattern(ConnectFourPattern connectFourPattern)
 {
     Patterns.Add(new ConnectFourPattern(connectFourPattern));
 }
 public void UpdatePattern(ConnectFourPattern pattern)
 {
     base.UpdatePattern(( BasicGamePattern )pattern);
 }
 public ConnectFourPattern(ConnectFourPattern patternSet) : base(patternSet)
 {
 }