Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Functions
game_view_layout.cpp File Reference
#include "game_view_layout.h"
#include "action_number.h"
#include "board_layout.h"
#include "helper.h"
#include "game_rect.h"
#include "game_coordinate.h"
#include "square.h"
#include "game_options.h"
#include <cassert>
#include <cmath>
#include <iostream>
#include <sstream>
Include dependency graph for game_view_layout.cpp:

Functions

game_coordinate convert_to_game_coordinate (const screen_coordinate &coordinat, const game_view_layout &layout)
 Convert an on-screen coordinat to an in-game coordinat.
 
screen_coordinate convert_to_screen_coordinate (const game_coordinate &c, const game_view_layout &layout)
 Convert an in-game coordinat to an on-screen coordinat.
 
screen_rect convert_to_screen_rect (const game_rect &r, const game_view_layout &layout)
 Convert an in-game coordinat to an on-screen coordinat.
 
screen_rect convert_to_screen_rect (const square &s, const game_view_layout &layout)
 Convert an in-game square to an on-screen screen rectange.
 
int get_board_height (const game_view_layout &layout) noexcept
 Get the height of the board in pixels.
 
int get_board_width (const game_view_layout &layout) noexcept
 Get the width of the board in pixels.
 
double get_square_height (const game_view_layout &layout) noexcept
 Get the height of a square.
 
double get_square_width (const game_view_layout &layout) noexcept
 Get the width of a square.
 
void test_game_view_layout ()
 Test the game_view_layout class.
 
std::ostream & operator<< (std::ostream &os, const game_view_layout &layout) noexcept
 

Function Documentation

◆ convert_to_game_coordinate()

game_coordinate convert_to_game_coordinate ( const screen_coordinate coordinat,
const game_view_layout layout 
)

Convert an on-screen coordinat to an in-game coordinat.

◆ convert_to_screen_coordinate()

screen_coordinate convert_to_screen_coordinate ( const game_coordinate c,
const game_view_layout layout 
)

Convert an in-game coordinat to an on-screen coordinat.

◆ convert_to_screen_rect() [1/2]

screen_rect convert_to_screen_rect ( const game_rect r,
const game_view_layout layout 
)

Convert an in-game coordinat to an on-screen coordinat.

◆ convert_to_screen_rect() [2/2]

screen_rect convert_to_screen_rect ( const square s,
const game_view_layout layout 
)

Convert an in-game square to an on-screen screen rectange.

◆ get_board_height()

int get_board_height ( const game_view_layout layout)
noexcept

Get the height of the board in pixels.

◆ get_board_width()

int get_board_width ( const game_view_layout layout)
noexcept

Get the width of the board in pixels.

◆ get_square_height()

double get_square_height ( const game_view_layout layout)
noexcept

Get the height of a square.

◆ get_square_width()

double get_square_width ( const game_view_layout layout)
noexcept

Get the width of a square.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const game_view_layout layout 
)
noexcept

◆ test_game_view_layout()

void test_game_view_layout ( )

Test the game_view_layout class.