Esempio n. 1
0
        //public string ScreenTiles => string.Join(", ", Tiles.ToList().Select(t => t.Id.ToString()));

        public Screen(Point absoluteCoordinates, Bitmap screenImage)
        {
            AbsoluteX = absoluteCoordinates.X;
            AbsoluteY = absoluteCoordinates.Y;

            var screenCoordinates = absoluteCoordinates.AbsoluteToScreen();

            ScreenX = screenCoordinates.X;
            ScreenY = screenCoordinates.Y;

            ScreenImage = screenImage;

            var tilesPerScreenRow    = Constants.ScreenWidthPixels / Constants.TileWidthPixels;
            var tilesPerScreenColumn = Constants.ScreenHeightPixels / Constants.TileHeightPixels;

            Tiles = new Tile[tilesPerScreenRow, tilesPerScreenColumn];
        }
Esempio n. 2
0
        public Tile(Point absoluteCoordinates, Bitmap tileImage)
        {
            Info.AbsoluteX = absoluteCoordinates.X;
            Info.AbsoluteY = absoluteCoordinates.Y;

            var screenCoordinates = absoluteCoordinates.AbsoluteToScreen();

            Info.ScreenX = screenCoordinates.X;
            Info.ScreenY = screenCoordinates.Y;

            var relativeCoordinates = absoluteCoordinates.AbsoluteToScreenTile();

            Info.RelativeX = relativeCoordinates.X;
            Info.RelativeY = relativeCoordinates.Y;

            TileImage = tileImage;
        }