Пример #1
0
        public static List <char> GetAllPlayerSymbols(Fields.Field field)
        {
            List <char> ret = new List <char>();

            for (int i = 0; i < field.Length; i++)
            {
                if (!ret.Contains(field.GetField(i)) && !String.IsNullOrEmpty(field.GetField(i).ToString().Trim()))
                {
                    ret.Add(field.GetField(i));
                }
            }
            return(ret);
        }
Пример #2
0
        public static string GetString(Fields.Field field)
        {
            string ret = null;

            for (int i = 0; i < field.Length; i++)
            {
                ret += field.GetField(i);
            }
            return(ret);
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="field">Das Spielfeld</param>
        /// <param name="dir">Die Richtung, in die überprüft werden soll.</param>
        /// <param name="player"></param>
        /// <param name="from">Der inklusive untere Vector der Startposition.</param>
        /// <returns></returns>
        private static int DoCheck(Fields.Field field, Directories dir, char player, Vector2i from)
        {
            int counter = 0;

            for (int a = 0; a < GewinnBedingung; a++)
            {
                if (field.GetField(from) == player)
                {
                    counter++;
                }
                else
                {
                    break;
                }
                from = NextField(dir, from);
            }
            return(counter);
        }