Exemplo n.º 1
0
 public ManagerInfo(int Code, string Name, String Surname, int Reputation, string BirthDay, int FirstNation, int SecondNation, RingBuffer Tactic, RingBuffer AlignmentOfDefence, RingBuffer AlignmentOfMiddlefield, RingBuffer AlignmentOfForward)
     : base(Code, Name, Surname, Reputation, BirthDay, FirstNation, SecondNation)
 {
     this.tactic                 = Tactic;
     this.alignmentOfForward     = AlignmentOfForward;
     this.alignmentOfDefence     = AlignmentOfDefence;
     this.alignmentOfMiddlefield = AlignmentOfMiddlefield;
 }
Exemplo n.º 2
0
        internal static int[] GetCountOfPlayersInAllLines(RingBuffer Tactic)
        {
            DataRow t = TableOfTotalTactic.FindByКод(Tactic.Value);

            return(new int[] { (int)t["Защита"], (int)t["Полузащита"], (int)t["Нападение"] });
        }
Exemplo n.º 3
0
 internal static int GetCountOfPlayersInLine(RingBuffer Tactic, int Line)
 {
     return(GetCountOfPlayersInAllLines(Tactic)[Line - 1]);
 }
Exemplo n.º 4
0
        //TODO
        internal static ManagerInfo GetManagerInfo(Manager Manager)
        {
            DataRow p  = TableOfPerson.FindByКод(Manager.Code);
            DataRow mi = TableOfManagerInfo.FindByКод(Manager.Code);

            object Name        = p["Имя"];
            object Country1    = p["Страна1"];
            object Country2    = p["Страна2"];
            object tacticIndex = mi["Тактика"];
            object defIndex    = mi["Расстановка защиты"];
            object midIndex    = mi["Расстановка полузащиты"];
            object frwIndex    = mi["Расстановка нападения"];

            if (Name is DBNull)
            {
                Name = "";
            }
            if (Country1 is DBNull)
            {
                System.Random RND = new System.Random();
                Country1 = RND.Next(1, 221);
            }
            if (Country2 is DBNull)
            {
                Country2 = 0;
            }
            if (tacticIndex is DBNull)
            {
                tacticIndex = 4;
            }
            if (defIndex is DBNull)
            {
                defIndex = 1;
            }
            if (midIndex is DBNull)
            {
                midIndex = 1;
            }
            if (frwIndex is DBNull)
            {
                frwIndex = 1;
            }
            RingBuffer Tactic = new RingBuffer(7, (int)tacticIndex);             //TODO
            RingBuffer Def    = new RingBuffer(0, (int)defIndex);
            RingBuffer Mid    = new RingBuffer(0, (int)midIndex);
            RingBuffer Frw    = new RingBuffer(0, (int)frwIndex);

            return(new ManagerInfo(
                       Manager.Code,
                       (string)Name,
                       (string)p["Фамилия"],
                       (int)p["Репутация"],
                       p["ДР"].ToString(),
                       (int)Country1,
                       (int)Country2,
                       (RingBuffer)Tactic,
                       (RingBuffer)Def,
                       (RingBuffer)Mid,
                       (RingBuffer)Frw
                       ));
        }