Beispiel #1
0
        public sbyte Center(bool needPositon)
        {
            foreach (var cubie in cubies)
            {
                CubiePosition cube = cubie.Position;

                if (cube.IsCenter())
                {
                    Debug.Assert(cubie.Color.IsCenter());
                    if (needPositon)
                    {
                        return(cubie.Position.a1);
                    }
                    else
                    {
                        return(cubie.Color.Color);
                    }
                }
            }

            throw new ApplicationException("No center found");
        }