Exemplo n.º 1
0
        public void OnReleased(MouseReleasedEvent e)
        {
            dragging = false;

            if (Collisions.CheckCollisions(game.RPlayer.MapDimension, NewDimension))
            {
                int TestX = NewDimension.X;
                int TestY = NewDimension.Y;
                RenderInfo.CalculateCoord(ref TestX, ref TestY, game.RPlayer);

                ship = FabricShips.GetShip(LenghtShips[currentPointer], shipType, TestX, TestY);

                bool NextShip = game.Player.PushShip(ship);
                if (NextShip)
                {
                    ++currentPointer;
                    if (currentPointer > 9)
                    {
                        NextState(game.WarState);
                    }
                    else
                    {
                        ResizeShip();
                    }
                }
            }
            else
            {
                RelocationShip();
            }
        }
Exemplo n.º 2
0
        private void Window_MouseUp(object sender, MouseEventArgs e)
        {
            MouseReleasedEvent me = new MouseReleasedEvent(e.Button, e.X, e.Y);

            OnEvent(me);
        }