コード例 #1
0
        public void ShouldCalculateTotalDistanceForOneBike()
        {
            var recordsBiker1 = new Record[] { new Record(0.5, 1), new Record(1, 2), new Record(2, 3) };
            var biker1        = new Biker("tibi", 0.6, recordsBiker1);

            Assert.AreEqual(6.594, CalculateTotalDistanceForOneBiker(biker1), 1);
        }
コード例 #2
0
        public IHttpActionResult CreateBiker(Biker biker)
        {
            var bike = db.Bikers.FirstOrDefault(x => x.Name == biker.Name && x.State == true || x.Email == biker.Email && x.State == true);

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            if (bike != null)
            {
                return(BadRequest("Ya exite un motorista con este nombre o correo."));
            }

            if (bike.Name == "" || bike.Email == "" || bike.Telephone == "" || bike.Password == "" || bike.Age == "")
            {
                return(BadRequest("Todos los campos deben de estar llenos."));
            }

            biker.State = true;

            db.Bikers.Add(biker);
            db.SaveChanges();

            return(Ok(new { message = "Motorista creado exitosamente." }));
        }
コード例 #3
0
ファイル: PhysicsManager.cs プロジェクト: EthanLerner1/-ALOHA
        public void bumped(Biker p)
        {
            jump(p);
            Vector2 tmp = new Vector2(-this.eng[p.ID].velocity.X * -0.7f, this.eng[p.ID].velocity.Y);

            this.eng[p.ID].speed = this.eng[p.ID].speed * -0.7f;
        }
コード例 #4
0
        public void ShouldCalculateTheAverageSpeedForOneBiker()
        {
            var recordsBiker1 = new Record[] { new Record(0.5, 1), new Record(1, 2), new Record(2, 3) };
            var biker1        = new Biker("tibi", 0.665, recordsBiker1);

            Assert.AreEqual(2.437, CalculateAverageSpeedForOneBiker(biker1), 1);
        }
コード例 #5
0
        /// <summary>
        /// finding both distance till obstacke [0]
        /// and both obstacke group width
        /// </summary>
        /// <param name="b">biker</param>
        /// <param name="ol">obstacle list</param>
        /// <returns></returns>
        public static List <float> findDif(Biker b, List <Obstacle> ol)
        {
            List <float> ret                = new List <float>();
            float        rightPoint         = b.Position.X + ((-b.Origin.X + b.CurrentFrame.Width) * b.scale.X);
            float        obstacle_leftPoint = -9999;
            float        obstacleWidth      = ol[0].CurrentFrame.Width * ol[0].scale.X;
            float        X = 0;

            for (int i = 0; i < ol.Count(); i++)
            {
                obstacle_leftPoint = ol[i].Position.X + ((-ol[i].Origin.X) * ol[i].scale.X);
                if (obstacle_leftPoint > rightPoint)
                {
                    ret.Add(obstacle_leftPoint - rightPoint);
                    X += obstacleWidth;
                    int tmpI = i + 1;
                    int cnt  = 1;
                    while (tmpI < ol.Count && obstacle_leftPoint + (obstacleWidth * cnt) + 10 >= (ol[tmpI].Position.X - (ol[tmpI].Origin.X * ol[tmpI].scale.X)))
                    {
                        X += obstacleWidth;
                        cnt++;
                        tmpI++;
                    }
                    ret.Add(X);
                    return(ret);
                }
            }
            //if (ret.Count == 0)
            //{
            //    Global.restartBots = true;
            //    Rank.restartBots(Global.copList);
            //    return findDif(b, ol);
            //}
            return(ret);
        }
コード例 #6
0
ファイル: PhysicsManager.cs プロジェクト: EthanLerner1/-ALOHA
        /// <summary>
        /// activates the gravity effect between the road and the player
        /// activates gravity when he is on the air
        /// </summary>
        /// <param name="player">Biker, the player that have interaction with the road</param>
        public collisionState roadPlayerInteraction(Biker player)
        {
            if (Collision.roadBikerState(Global.bg.currentLevel, player) == collisionState.collision)
            {//stoping hes movment on the Y axis
                this.eng[player.ID].velocity = new Vector2(this.eng[player.ID].speed, 0);


                if (!player.keys.Right())
                {
                    this.eng[player.ID].velocity = new Vector2(this.eng[player.ID].velocity.X - (0.1f / Global.fps), 0);
                    this.eng[player.ID].speed    = this.eng[player.ID].velocity.X - (0.1f / Global.fps);
                }
                if (player.keys.Space())
                {
                    jump(player);
                }


                // allowing the biker to paddle
                return(collisionState.collision);
            }
            else // activate gravity and air firction
            {
                this.eng[player.ID].velocity = new Vector2(this.eng[player.ID].velocity.X - (0.1f / Global.fps), this.eng[player.ID].velocity.Y + g / Global.fps);
                this.eng[player.ID].speed    = this.eng[player.ID].velocity.X - (0.1f / Global.fps);
            }

            return(collisionState.noCollision);
        }
コード例 #7
0
        public void ShouldFindMaxRotationsForOneBiker()
        {
            var recordsBiker1 = new Record[] { new Record(0.5, 1), new Record(2, 2), new Record(7, 3), new Record(5, 4) };
            var biker1        = new Biker("tibi", 0.665, recordsBiker1);

            Assert.AreEqual(new Record(7, 3), FindMaxRotationsForOneBiker(biker1));
        }
コード例 #8
0
        public static float findDifNext(Biker b, List <Obstacle> ol)
        {
            float rightPoint         = b.Position.X + ((-b.Origin.X + b.CurrentFrame.Width) * b.scale.X);
            float obstacle_leftPoint = -9999;
            float obstacleWidth      = ol[0].CurrentFrame.Width * ol[0].scale.X;
            bool  next = false;

            for (int i = 0; i < ol.Count(); i++)
            {
                obstacle_leftPoint = ol[i].Position.X + ((-ol[i].Origin.X) * ol[i].scale.X);
                if (obstacle_leftPoint > rightPoint)
                {
                    int tmpI = i + 1;
                    int cnt  = 1;
                    while (tmpI < ol.Count && obstacle_leftPoint + (obstacleWidth * cnt) + 10 >= (ol[tmpI].Position.X - (ol[tmpI].Origin.X * ol[tmpI].scale.X)))
                    {
                        tmpI++;
                        cnt++;
                    }
                    next = true;
                    if (tmpI + 1 < ol.Count)
                    {
                        return(ol[tmpI + 1].Position.X + ((-ol[tmpI + 1].Origin.X) * ol[tmpI + 1].scale.X) - rightPoint);
                    }
                    else
                    {
                        return(-999);
                    }
                }
            }
            return(-999);
        }
コード例 #9
0
        double CalculateAverageSpeedForOneBiker(Biker biker)
        {
            double distance  = CalculateTotalDistanceForOneBiker(biker);
            int    totalTime = biker.record.Length;

            return(distance / totalTime);
        }
コード例 #10
0
        public static float FindJumpPickPosX(Biker b)
        {
            //const, data
            float g   = Tools.pm.g;
            float v0Y = (-40 * g / Global.fps) * b.jumpForce;

            g /= Global.fps;

            //all calculations reagrds to the middle of the biker
            Vector2 middle = b.Position - (b.Origin * b.scale);

            middle = new Vector2(middle.X + (b.CurrentFrame.Width / 2 * b.scale.X), middle.Y + b.CurrentFrame.Height / 2 * b.scale.Y);

            //finding the max height the jumper would arrive
            float h = (float)Math.Pow((v0Y), 2) / (2 * g);

            // finding t from the formula y = y0 + v0t + 0.5 at^2
            List <float> t    = Tools.quadraticEquation((float)(0.5 * g), v0Y, -h);
            float        time = 0;

            for (int i = 0; i < t.Count; i++) // one of the answers is negativ and the other is positive  i need to find the positive one
            {
                if (t[i] > 0)
                {
                    time = t[i];
                    break;
                }
            }

            // finding position X by x = x0+v0t+0.5at^2
            float X = (float)middle.X + Tools.pm.getEngine(b.ID).velocity.X *time + (float)(0.5f * Math.Pow(time, 2) * (-0.1f / Global.fps));

            return(X);
        }
コード例 #11
0
 /// <summary>
 /// is the biker given is able to jump
 /// </summary>
 /// <param name="b"></param>
 /// <returns></returns>
 public static bool CanJump(Biker b)
 {
     if (b.touchesGround == collisionState.collision)
     {
         return(true);
     }
     return(false);
 }
コード例 #12
0
        public void ShouldCalculateTotalDistance()
        {
            var recordsBiker1 = new Record[] { new Record(0.5, 1), new Record(1, 2), new Record(2, 3) };
            var recordsBiker2 = new Record[] { new Record(1, 1), new Record(2, 2), new Record(3, 3) };
            var biker1        = new Biker("tibi", 0.665, recordsBiker1);
            var biker2        = new Biker("paul", 0.665, recordsBiker2);

            Assert.AreEqual(19.847, CalculateTotalDistance(new Biker[] { biker1, biker2 }), 1);
        }
コード例 #13
0
        private void OnTriggerExit(UnityEngine.Collider collision)
        {
            Biker biker = collision.gameObject.GetComponent <Biker>();

            if (biker != null)
            {
                SetStatus(0);
            }
        }
コード例 #14
0
ファイル: Collision.cs プロジェクト: EthanLerner1/-ALOHA
        /// <summary>
        /// this function checks if the biker is on the air or not
        /// </summary>
        /// <param name="currentLevel">Level, the currnet level in the game </param>
        /// <param name="player">Biker, the player checked</param>
        /// <returns></returns>
        public static collisionState roadBikerState(Level currentLevel, Biker player)
        {
            Vector2 offset   = player.Position - (player.Origin * player.scale);
            float   yOfWheel = (player.bWheel.position.Y + player.bWheel.radius) * player.scale.X + offset.Y;

            if (yOfWheel < (currentLevel.groundPos.Y * Global.scale))
            {
                return(collisionState.noCollision);
            }
            return(collisionState.collision);
        }
コード例 #15
0
        double CalculateTotalDistanceForOneBiker(Biker biker)
        {
            double distance    = 0;
            double wheelLength = Math.PI * biker.diameter;

            for (int i = 0; i < biker.record.Length; i++)
            {
                distance += wheelLength * biker.record[i].rotations;
            }
            return(distance);
        }
コード例 #16
0
        public void ShouldCalculateBestAverageSpeed()
        {
            var bikers = new Biker[] {
                new Biker("tibi", 0.75, new Record[] { new Record(0.5, 1), new Record(1, 2) }),
                new Biker("paul", 0.95, new Record[] { new Record(1, 1), new Record(2, 2) }),
                new Biker("ana", 0.45, new Record[] { new Record(1, 1), new Record(2, 2) }),
                new Biker("maria", 0.35, new Record[] { new Record(0.5, 1), new Record(1, 2) })
            };

            Assert.AreEqual("paul", FindBestBikerAverageSpeed(bikers));
        }
コード例 #17
0
        public void ShoulReturnNameAndSecondOfTopSpeedBiker()
        {
            var bikers = new Biker[] {
                new Biker("tibi", 0.75, new Record[] { new Record(0.5, 1), new Record(1, 2) }),
                new Biker("paul", 0.95, new Record[] { new Record(1, 1), new Record(5, 2) }),
                new Biker("ana", 0.45, new Record[] { new Record(1, 1), new Record(2, 2) }),
                new Biker("maria", 0.35, new Record[] { new Record(0.5, 1), new Record(1, 2) })
            };
            NameAndSecond result = new NameAndSecond("paul", 2);

            Assert.AreEqual(result, FindBestBikerSpeed(bikers));
        }
コード例 #18
0
ファイル: Collision.cs プロジェクト: EthanLerner1/-ALOHA
        /// <summary>
        /// this function checks the collision of the biker with an obstacle and returns the collision state
        /// </summary>
        /// <param name="block">obstace</param>
        /// <param name="player">player checked</param>
        /// <returns></returns>
        public static collisionState BikerObstacle(Obstacle block, Biker player)
        {
            Vector2 offsetplayer = player.Position - (player.Origin * Global.playerScale);
            Vector2 offsetBlock  = block.Position - (block.Origin * block.scale);
            ////// circle equlation
            ////// (x-a)^2 + (y-b)^2 = R^2
            ////// (a,b) middle of the circle, R radius of the circle
            //back wheel
            int   a1 = (int)(player.bWheel.position.X * Global.playerScale + offsetplayer.X);
            int   b1 = (int)(player.bWheel.position.Y * Global.playerScale + offsetplayer.Y);
            float R1 = player.bWheel.radius * Global.playerScale;
            //front wheel
            int   a2 = (int)(player.fWheel.position.X * Global.playerScale + offsetplayer.X);
            int   b2 = (int)(player.fWheel.position.Y * Global.playerScale + offsetplayer.Y);
            float R2 = player.fWheel.radius * Global.playerScale;

            Vector2 route = offsetBlock;

            for (int i = 1; i < block.frame.Count(); i++)
            {
                route += (block.frame[i - 1] * block.scale);
                Vector2      finalPoint          = route + (block.frame[i] * block.scale);
                List <float> linearEq            = Tools.findLinerEquationFromPoints(route.ToPoint(), finalPoint.ToPoint());
                List <Point> colisionPointsBack  = LineCircleCollision(linearEq, new Point(a1, b1), R1);
                List <Point> colisionPointsFront = LineCircleCollision(linearEq, new Point(a2, b2), R2);
                //(x,y) - collsion point
                // if (start vector point <(x,y) < finish vector point )
                // then there is truelly a collision

                if (((offsetplayer + (player.fWheel.position * Global.playerScale)) - new Vector2(colisionPointsFront[0].X, colisionPointsFront[0].Y))
                    .Length() <= (player.fWheel.radius * Global.playerScale))
                {
                    return(collisionState.collision);
                }
                if (((offsetplayer + (player.fWheel.position * Global.playerScale)) - new Vector2(colisionPointsFront[1].X, colisionPointsFront[1].Y))
                    .Length() <= (player.fWheel.radius * Global.playerScale))
                {
                    return(collisionState.collision);
                }
                if (((offsetplayer + (player.bWheel.position * Global.playerScale)) - new Vector2(colisionPointsBack[0].X, colisionPointsBack[0].Y))
                    .Length() <= (player.fWheel.radius * Global.playerScale))
                {
                    return(collisionState.collision);
                }
                if (((offsetplayer + (player.bWheel.position * Global.playerScale)) - new Vector2(colisionPointsBack[1].X, colisionPointsBack[1].Y))
                    .Length() <= (player.fWheel.radius * Global.playerScale))
                {
                    return(collisionState.collision);
                }
            }
            return(collisionState.noCollision);
        }
コード例 #19
0
        Record FindMaxRotationsForOneBiker(Biker biker)
        {
            Record maxRotations = biker.record[0];

            for (int i = 1; i < biker.record.Length; i++)
            {
                if (biker.record[i].rotations > maxRotations.rotations)
                {
                    maxRotations = biker.record[i];
                }
            }
            return(maxRotations);
        }
コード例 #20
0
ファイル: Collision.cs プロジェクト: EthanLerner1/-ALOHA
        /// <summary>
        /// checks if biker "p" reached the flag
        /// </summary>
        /// <param name="p">biker</param>
        /// <param name="line">flag</param>
        /// <returns></returns>
        public static collisionState finishLineBiker(Biker p, Flag line)
        {
            float lineLeft    = line.Position.X - (line.Origin.X * line.scale.X);
            float bikerRightP = p.Position.X - (p.Origin.X * p.scale.X) + (p.CurrentFrame.Width * p.scale.X);

            if (lineLeft <= bikerRightP)
            {
                return(collisionState.collision);
            }
            else
            {
                return(collisionState.noCollision);
            }
        }
コード例 #21
0
        /// <summary>
        /// returns next Obstacle
        /// if there is no closest obstacle returning -999
        /// </summary>
        /// <param name="ol">List<Obstacle></Obstacle></param>
        /// <param name="b">Biker</param>
        /// <returns></returns>
        public static float GetFirstObstaclePosX(List <Obstacle> ol, Biker b)
        {
            float rightPoint         = b.Position.X + ((-b.Origin.X + b.CurrentFrame.Width) * b.scale.X);
            float obstacle_leftPoint = -9999;

            for (int i = 0; i < ol.Count(); i++)
            {
                obstacle_leftPoint = ol[i].Position.X + ((-ol[i].Origin.X) * ol[i].scale.X);
                if (obstacle_leftPoint > rightPoint)
                {
                    return(obstacle_leftPoint);
                }
            }
            return(-999);
        }
コード例 #22
0
        /// <summary>
        /// return time untill arivel to closet obstacle
        /// if there is no closest obstacle returning -999
        /// </summary>
        /// <param name="ol">List<Obstacle></Obstacle></param>
        /// <param name="b">Biker</param>
        /// <returns></returns>
        public static float TimeTillFirstObstacle(List <Obstacle> ol, Biker b)
        {
            float xSpeed             = Tools.pm.getEngine(b.ID).velocity.X;
            float rightPoint         = b.Position.X + ((-b.Origin.X + b.CurrentFrame.Width) * b.scale.X);
            float obstacle_leftPoint = -999;

            for (int i = 0; i < ol.Count(); i++)
            {
                obstacle_leftPoint = ol[i].Position.X + ((-ol[i].Origin.X) * ol[i].scale.X);
                if (obstacle_leftPoint > rightPoint)
                {
                    return((obstacle_leftPoint - rightPoint) / xSpeed);
                }
            }
            return(-999);
        }
コード例 #23
0
        public static void Init()
        {
            scale       = 0.2f;
            playerScale = 0.5f;
            zoom        = 1.2f;
            fps         = 60;

            //ML
            copList = new List <Cop>();
            NeuralNet n5 = new NeuralNet("stages/s3.txt");

            //biker
            Texture2D[] biker = Animation.loadTextures("playerGif", 10);
            me = new Biker("masks/Bikermask", biker, new UserKeys(Keys.Left, Keys.Right, Keys.Space), 0, PhysicsManager.createAndGetNewEngine(50, 0.2f, 25, 1),
                           Tools.cm.Load <Texture2D>("playerGif/0"), new Vector2(0, -100), null, Color.White, 0, new Vector2(97, 65),
                           new Vector2(Global.playerScale), 0, 0, Tools.pm, 1);

            player2 = new Biker("masks/Bikermask", biker, new UserKeys(Keys.A, Keys.D, Keys.W), 1, PhysicsManager.createAndGetNewEngine(50, 0.2f, 25, 1),
                                Tools.cm.Load <Texture2D>("playerGif/0"), new Vector2(0, -100), null, Color.Red, 0, new Vector2(97, 65),
                                new Vector2(Global.playerScale), 0, 0, Tools.pm, 1);

            //cop
            Texture2D[] copArray = Animation.loadTextures("copGif", 10);
            cop1 = new Biker("masks/policeCarM", copArray, new BotKeys(), 2, PhysicsManager.createAndGetNewEngine(50, 0.2f, 25, 1),
                             Tools.cm.Load <Texture2D>("copGif/0"), new Vector2(0, -100), null, Color.White, 0, new Vector2(730, 1440),
                             new Vector2(0.1f), 0, 0.1f, Tools.pm, 1.2f);
            cop1.kill();



            fWheel = cop1.fWheel;
            bWheel = cop1.bWheel;
            area   = cop1.area;
            cp     = cop1.coliisionPoints;

            cop = new Cop(n5, "masks/policeCarM", copArray, new BotKeys(), 2, PhysicsManager.createAndGetNewEngine(50, 0.2f, 25, 1),
                          Tools.cm.Load <Texture2D>("copGif/0"), new Vector2(0, -100), null, Color.White, 0, new Vector2(730, 1440),
                          new Vector2(0.1f), 0, 0.1f, Tools.pm, 1.2f);
            //background
            bg = new Background();
            bg.init();

            //nextLevel
            Background.Event_NextLevel += nxtlevel;
        }
コード例 #24
0
        public IHttpActionResult UpdateBiker([FromUri] int Bikerid, Biker biker)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            if (Bikerid != biker.IdBiker)
            {
                return(BadRequest("Motorista no existe."));
            }

            db.Entry(biker).State = EntityState.Modified;

            db.SaveChanges();

            return(Ok(new { message = "El motorista se actualizo correctamente." }));
        }
コード例 #25
0
ファイル: MainWindow.xaml.cs プロジェクト: Markellian/Window-
 /// <summary>
 /// Удаление Члена клуба
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DeleteMembers_Click(object sender, RoutedEventArgs e)
 {
     biker = (Biker)ListViewMembers.SelectedItem;
     if (biker != null)
     {
         if (biker.Connection != null)
         {
             foreach (var v in biker.Connection)
             {
                 v.Connection.Remove(biker);
             }
         }
         listBiker.Remove(biker);
         CreateConnection();
         ListViewMembers.ItemsSource = null;
         ListViewMembers.ItemsSource = listBiker;
     }
 }
コード例 #26
0
ファイル: MainWindow.xaml.cs プロジェクト: Markellian/Window-
        /// <summary>
        /// Добавить связь для Члена клуба
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddConectionMember_Click(object sender, RoutedEventArgs e)
        {
            if (MembersFromRandonnees.SelectedItem != null)
            {
                AddConnection addConnection = new AddConnection();
                item = (TreeViewItem)MembersFromRandonnees.SelectedItem;
                foreach (var v in listBiker)
                {
                    if (item.Header.ToString() == v.FIO.ToString())
                    {
                        biker = v;
                    }
                }
                ;
                List <Randonnee> randonnees = new List <Randonnee>();
                foreach (var it in listRandonnee)
                {
                    randonnees.Add(it);
                }
                DeleteAllConnectionsInList(randonnees);

                addConnection.StartForMembers(randonnees);
                addConnection.ShowDialog();

                stroka = addConnection.ReternData();
                if (stroka != "")
                {
                    item1 = new TreeViewItem
                    {
                        Header = stroka
                    };
                    foreach (var v in listRandonnee)
                    {
                        if (item1.Header.ToString() == v.Name.ToString())
                        {
                            randonnee = v;
                        }
                    }
                    biker.Connection.Add(randonnee);
                    randonnee.Connection.Add(biker);
                    CreateConnection();
                }
            }
        }
コード例 #27
0
ファイル: MainWindow.xaml.cs プロジェクト: Markellian/Window-
 /// <summary>
 /// Нахождения двух связанных элементов по Члену клуба
 /// </summary>
 private void FindConnectiveObjectsForMembers()
 {
     item  = (TreeViewItem)MembersFromRandonnees.SelectedItem;
     item1 = (TreeViewItem)item.Parent;
     foreach (var b in listBiker)
     {
         if (item1.Header.ToString() == b.FIO.ToString())
         {
             foreach (var c in b.Connection)
             {
                 if (c.Name.ToString() == item.Header.ToString())
                 {
                     biker     = b;
                     randonnee = c;
                 }
             }
         }
     }
 }
コード例 #28
0
ファイル: MainWindow.xaml.cs プロジェクト: Markellian/Window-
 /// <summary>
 /// Нахождение двух связанных элементов по Покатушке
 /// </summary>
 private void FindConnectiveObjectsForRandonnees()
 {
     item  = (TreeViewItem)RandonneesFromMembers.SelectedItem;
     item1 = (TreeViewItem)item.Parent;
     foreach (var r in listRandonnee)
     {
         if (item1.Header.ToString() == r.Name.ToString())
         {
             foreach (var c in r.Connection)
             {
                 if (c.FIO.ToString() == item.Header.ToString())
                 {
                     biker     = c;
                     randonnee = r;
                 }
             }
         }
     }
 }
コード例 #29
0
        public static void WriteNecceryUpdataData(BinaryWriter writer, Biker me, List <Obstacle> ol)
        {
            #region order

            /* float, my posX
             * float, my posY
             * int, switchframe, 0 non, 1 regular, -1 reverse
             * list<Boolean>, which obstacle exploaded
             * int, my score
             */
            #endregion
            //float
            writer.Write(me.Position.X);
            writer.Write(me.Position.X);

            //int
            order tmp = me.switchF;
            if (tmp == order.regular)
            {
                writer.Write(1);
            }
            else
            {
                if (tmp == order.none)
                {
                    writer.Write(0);
                }
                else
                {
                    writer.Write(-1);
                }
            }

            //bool
            for (int i = 0; i < ol.Count(); i++)
            {
                writer.Write(ol[i].switchFrames);
            }
            writer.Write(Global.myScore);
        }
コード例 #30
0
ファイル: MainWindow.xaml.cs プロジェクト: Markellian/Window-
//Таблица Члены клуба
        /// <summary>
        /// Добавление нового Члена клуба
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void AddMember_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Window w = new Window();
                w.ShowDialog();
                biker = w.Start();
                if (biker != null)
                {
                    listBiker.Add(biker);
                    ListViewMembers.ItemsSource = null;
                    ListViewMembers.ItemsSource = listBiker;

                    item = new TreeViewItem
                    {
                        Header = biker.FIO.ToString()
                    };
                    MembersFromRandonnees.Items.Add(item);
                    Save(nameFile);
                }
            }
            catch (InvalidOperationException) { MessageBox.Show("Не удалось создать новый элемент!", "Ошибка!"); }
        }