using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Igdc.Scenes.UI.Controls;
using Igdc.Drawables;

namespace Igdc.Scenes
{
    public class MenuScene : UiScene
    {
        public static UiPackage CreatePackage()
            => new UiPackage
            {
                Controls = new ControlBase[]
                {
                    new Background { Color = Palette.Dark },
                    new TextBlock
                    {
                        Font = IgdcGame.Current.BasicFont,
                        BorderTexture = IgdcGame.Current.FlatTexture,
                        BorderColor = Palette.Light,
                        Text = "ПРИКЛЮЧЕНИЕ КРОЛИКА\n\nСмело нажимайте \"Новая игра\", так эта игра буквально только что вышла и уж точно старой её не назвать!\nВеселых вам приключений!",
                        TextColor = Palette.Light,
                        Location = new Point(0, 0),
                        Size = new Point(160, 124)
                    },
                    new Button
                    {
                        Font = IgdcGame.Current.BasicFont,
                        Texture = IgdcGame.Current.FlatTexture,
                        ActiveBackground = Palette.Blue2,
                        InactiveBackground = Palette.Blue1,
                        ActiveForeground = Palette.Light,
                        InactiveForeground = Palette.Tan2,
                        Content = "Новая игра",
                        Command = () =>
                        {
                            IgdcGame.Current.Navigate<MapScene>(new MapPackage
                            {
                                Background = 1,
                                MapLink = "1",
                                Player = new MapPlayer { X = 13, Y = 26 },
                                Allies = new[]
                                {
                                    new MapAlly { X = 13, Y = 19, Texture = 1, Story = "Морковная" }
                                },
                                Enemies = new []
                                {
                                    new MapEnemy { X = 09, Y = 16, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 12, Y = 16, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 15, Y = 16, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 18, Y = 16, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 09, Y = 14, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 12, Y = 14, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 15, Y = 14, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 18, Y = 14, Texture = 1, Difficulty = 1 },
                                    new MapEnemy { X = 09, Y = 12, Texture = 1, Difficulty = 2 },
                                    new MapEnemy { X = 12, Y = 12, Texture = 1, Difficulty = 2 },
                                    new MapEnemy { X = 15, Y = 12, Texture = 1, Difficulty = 2 },
                                    new MapEnemy { X = 18, Y = 12, Texture = 1, Difficulty = 2 },

                                    new MapEnemy { X = 24, Y = 05, Texture = 2, Difficulty = 3 },
                                    new MapEnemy { X = 27, Y = 05, Texture = 2, Difficulty = 3 },
                                    new MapEnemy { X = 24, Y = 07, Texture = 2, Difficulty = 3 },
                                    new MapEnemy { X = 27, Y = 07, Texture = 2, Difficulty = 3 },
                                    new MapEnemy { X = 24, Y = 09, Texture = 2, Difficulty = 3 },
                                    new MapEnemy { X = 27, Y = 09, Texture = 2, Difficulty = 3 },

                                    new MapEnemy { X = 06, Y = 27, Texture = 3, Difficulty = 4 },
                                }
                            });
                        },
                        Location = new Point(0, 124),
                        Size = new Point(80, 20)
                    },
                    new Button
                    {
                        Font = IgdcGame.Current.BasicFont,
                        Texture = IgdcGame.Current.FlatTexture,
                        ActiveBackground = Palette.Blue2,
                        InactiveBackground = Palette.Blue1,
                        ActiveForeground = Palette.Light,
                        InactiveForeground = Palette.Tan2,
                        Content = "Выход",
                        Command = () => IgdcGame.Current.Exit(),
                        Location = new Point(80, 124),
                        Size = new Point(80, 20)
                    }
                }
            };

        public MenuScene(GraphicsDeviceManager manager, GraphicsDevice device, object package) : base(manager, device, CreatePackage())
        {
        }
    }
}