Exemplo n.º 1
0
 public void Set(TCell Pos)
 {
     this.i = Pos.i;
     this.j = Pos.j;
     this.B = Pos.B;
     this.n = Pos.n;
 }
        public void Add(string chordName, TNote[] chord)
        {
            if (chordName == null)
                throw new ArgumentNullException(chordName);

            _chords.Add(new Chord(chordName, Music.ChordGenerator.findShape(standardGuitar, 0, 3, chord)));
        }
Exemplo n.º 3
0
        public TCell(int i, int j)
        {
            this.i = i;
            this.j = j;

            n = i + 1;
            B = (TNote)j;
        }
Exemplo n.º 4
0
        public TCell(TNote B, int n)
        {
            this.B = B;
            this.n = n;

            i = (int)B;

            j = 8 - n;
        }
Exemplo n.º 5
0
        private int YCoordinate()
        {
            int NoteIndex, OctaveVar;

            _NoteCollection = (TNote)_NoteString[0] - 64;
            NoteIndex       = (int)_NoteCollection;
            OctaveVar       = int.Parse(_NoteString[1].ToString());
            return(STARTINGYCOORD - (7 * (NoteIndex - 1)) - (43 * (OctaveVar)));
        }//Converts string into the given enumerated types
Exemplo n.º 6
0
        //Methods

        override public void ToEnum(string DictionaryIndex)
        {
            int Index1, Index2;

            Index1       = int.Parse(DictionaryIndex[0].ToString());
            Index2       = int.Parse(DictionaryIndex[1].ToString());
            _Note        = (TNote)Index1;
            _OctaveIndex = (TOctaveIndex)Index2;
            _Variation   = TVariation.Natural;
        }//Converts string into the given enumerated types
Exemplo n.º 7
0
        public TCell GetCell(Point XY)
        {
            double L  = g.Width; // сохранить размер игрового поля
            double L8 = L / 8.0;

            double x = XY.X;
            double y = XY.Y;

            if ((x < 0) || (x > L) || (y < 0) || (y > L))
            {
                return(null);
            }

            int a = Convert.ToInt16(Math.Ceiling(x / L8));

            TNote Z = (TNote)(a - 1);

            a = Convert.ToInt16(Math.Ceiling(y / L8));
            int n = 9 - a;

            return(new TCell(Z, n));
        }
Exemplo n.º 8
0
        static bool Days(TNote User, ref int counter)
        {
            int[]  nMonths = new int[] { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
            string s = Convert.ToString(DateTime.Now);
            int    monthsec = (s[3] - '0') * 10 + s[4] - '0', daysec = (s[0] - '0') * 10 + (s[1] - '0'), Hoursec = (s[11] - '0') * 10 + s[12] - '0', Minutesec = (s[14] - '0') * 10 + s[15] - '0';

            if (monthsec > User.Month || (daysec > User.Day && monthsec == User.Month) || (daysec == User.Day && monthsec == User.Month && (Hoursec > User.Hour || (Hoursec == User.Hour && Minutesec > User.Minute))))
            {
                return(false);
            }
            else
            {
                while (monthsec != User.Month || daysec != User.Day)
                {
                    if (daysec == nMonths[monthsec])
                    {
                        monthsec++; daysec = 0;
                    }
                    daysec++;
                    counter++;
                }
                return(true);
            }
        }
Exemplo n.º 9
0
        public TCell NearDama(int dir, TPole Pole)
        {
            TNote  B_ = B;
            int    n_ = n;
            TCheck Who;

            if (dir == 1)
            {
                while ((B_ != TNote.A) && (n_ != 8))
                {
                    B_ = B_ - 1;
                    n_ = n_ + 1;
                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who != null)
                    {
                        return(new TCell(B_, n_));
                    }
                }
            }

            if (dir == 2)
            {
                while ((B_ != TNote.H) && (n_ != 8))
                {
                    B_ = B_ + 1;
                    n_ = n_ + 1;
                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who != null)
                    {
                        return(new TCell(B_, n_));
                    }
                }
            }

            if (dir == 3)
            {
                while ((B_ != TNote.A) && (n_ != 1))
                {
                    B_ = B_ - 1;
                    n_ = n_ - 1;
                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who != null)
                    {
                        return(new TCell(B_, n_));
                    }
                }
            }

            if (dir == 4)
            {
                while ((B_ != TNote.H) && (n_ != 1))
                {
                    B_ = B_ + 1;
                    n_ = n_ - 1;
                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who != null)
                    {
                        return(new TCell(B_, n_));
                    }
                }
            }

            return(null);
        }
Exemplo n.º 10
0
        public TCell[] NearsDama(int dir, TPole Pole)
        {
            ArrayList arr = new ArrayList(8);

            TNote B_ = B;
            int   n_ = n;

            arr.Add(new TCell(B_, n));

            TCheck Who;

            if (dir == 1)
            {
                while ((B_ != TNote.A) && (n_ != 8))
                {
                    B_ = B_ - 1;
                    n_ = n_ + 1;

                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who == null)
                    {
                        arr.Add(new TCell(B_, n_));
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (dir == 2)
            {
                while ((B_ != TNote.H) && (n_ != 8))
                {
                    B_ = B_ + 1;
                    n_ = n_ + 1;
                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who == null)
                    {
                        arr.Add(new TCell(B_, n_));
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (dir == 3)
            {
                while ((B_ != TNote.A) && (n_ != 1))
                {
                    B_ = B_ - 1;
                    n_ = n_ - 1;
                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who == null)
                    {
                        arr.Add(new TCell(B_, n_));
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (dir == 4)
            {
                while ((B_ != TNote.H) && (n_ != 1))
                {
                    B_ = B_ + 1;
                    n_ = n_ - 1;
                    Pole.Who(new TCell(B_, n_), out Who);
                    if (Who == null)
                    {
                        arr.Add(new TCell(B_, n_));
                    }
                    else
                    {
                        break;
                    }
                }
            }

            TCell[] Res = null;

            if (arr.Count > 0)
            {
                Res = new TCell[arr.Count];

                for (int i = 0; i < arr.Count; i++)
                {
                    Res[i] = (TCell)arr[i];
                }
            }

            return(Res);
        }