Ejemplo n.º 1
0
 public IsometricTest(LegatusGame game, int width, int depth, int height)
 {
     Game  = game;
     Input = new InputEventHandler();
     Input.KeyboardAction += OnKeyboardAction;
     Input.MouseDrag      += OnMouseDrag;
     Input.MouseScroll    += OnMouseScroll;
     RNG             = new Random();
     Block           = game.Content.Load <Texture2D>("Graphics/Isometric/IsometricBlock.png");
     BorderlessBlock = game.Content.Load <Texture2D>("Graphics/Isometric/IsometricBlockBorderless.png");
     Floor           = game.Content.Load <Texture2D>("Graphics/Isometric/IsometricFloor.png");
     BorderlessFloor = game.Content.Load <Texture2D>("Graphics/Isometric/IsometricFloorBorderless.png");
     Wall            = game.Content.Load <Texture2D>("Graphics/Isometric/IsometricWall.png");
     White           = game.Content.Load <Texture2D>("Graphics/WhiteTile.png");
     Font            = game.Content.Load <SpriteFont>("Graphics/DefaultFont12");
     TileGrid        = new Tile[width, depth, height];
     for (int z = 0; z < height; z++)
     {
         for (int y = 0; y < depth; y++)
         {
             for (int x = 0; x < width; x++)
             {
                 TileGrid[x, y, z] = new Tile(this, x, y, z);
             }
         }
     }
     GenerateMap();
 }
Ejemplo n.º 2
0
        public FlagTest(LegatusGame game)
        {
            Game   = game;
            Input  = new InputReceiverHandler(this);
            Width  = game.Window.ClientBounds.Width;
            Height = game.Window.ClientBounds.Height;

            Flags = new List <Texture2D>();
            GenerateFlags();
        }
Ejemplo n.º 3
0
 public UIViewport(int x, int y, int width, int height, IUIView view, LegatusGame game)
     : base(x, y, width, height)
 {
     View                    = view;
     GraphicsDevice          = game.GraphicsDevice;
     RenderTarget            = new RenderTarget2D(game.GraphicsDevice, width, height);
     game.Disposed          += OnGameDisposed;
     TakesFocusOnMouseAction = true;
     TakesFocusOnMouseAction = true;
 }
Ejemplo n.º 4
0
 public LanguageTest(LegatusGame game)
 {
     Input = new InputEventHandler();
     Input.KeyboardAction += OnKeyboardAction;
     //Input.KeyReleased += new KeyReleasedDelegate(OnKeyReleased);
     Font    = game.Content.Load <SpriteFont>("Graphics/DefaultFont12IPA");
     Factory = new ProceduralLanguageFactory(RNG);
     CreateLanguages();
     CreateWords();
     CreateLoanwords();
 }
Ejemplo n.º 5
0
 public GameUI(LegatusGame game, InputEventHandler input)
 {
     Game                   = game;
     Children               = new List <UIElement>();
     input.KeyboardAction  += OnKeyboardAction;
     input.MouseOver       += OnMouseOver;
     input.MouseAction     += OnMouseAction;
     input.MouseDrag       += OnMouseDrag;
     input.MouseScroll     += OnMouseScroll;
     game.Window.TextInput += OnTextInput;
 }
Ejemplo n.º 6
0
 public AITest(LegatusGame game, int width, int height)
 {
     RNG             = new Random();
     LanguageFactory = new ProceduralLanguageFactory(RNG);
     TileTexture     = game.Content.Load <Texture2D>("Graphics/WhiteTile.png");
     Font            = game.Content.Load <SpriteFont>("Graphics/DefaultFont12");
     Input           = new InputReceiverHandler(this);
     Factions        = new List <Faction>();
     Cities          = new List <City>();
     Units           = new List <Unit>();
     Generate(width, height);
 }
Ejemplo n.º 7
0
        public LOSTest(LegatusGame game, int width, int height)
        {
            Width  = width;
            Height = height;
            Size   = Width * Height;
            Tiles  = new Tile[Width, Height];
            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    Tiles[x, y] = new Tile(this, x, y);
                }
            }
            POVTile     = Tiles[0, 0];
            Input       = new InputReceiverHandler(this);
            TileTexture = game.Content.Load <Texture2D>("Graphics/WhiteTile.png");

            Line       = new List <Point>();
            LineOrigin = Point.Zero;
        }
Ejemplo n.º 8
0
 public ModManager(LegatusGame game)
 {
     Game           = game;
     TextureAtlases = new TextureAtlasManager(game);
     Load();
 }
Ejemplo n.º 9
0
 public ScriptTest(LegatusGame game)
 {
     Input = new InputReceiverHandler(this);
 }