File: PositionCalculator.h

package info (click to toggle)
clanlib 1.0~svn3827-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 24,600 kB
  • sloc: cpp: 101,591; xml: 6,410; makefile: 1,743; ansic: 463; perl: 424; php: 247; sh: 53
file content (23 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef HEADER_POSITION_CALCULATOR_H
#define HEADER_POSITION_CALCULATOR_H

#include <ClanLib/core.h>

class Puzzle;

class PositionCalculator
{
public:
	PositionCalculator(Puzzle const & puzzle, CL_Size const & sprite_size, int step = 5);
	~PositionCalculator();
public:
	CL_Point ScreenToField(CL_Point const & screen_coord) const;
	CL_Point FieldToScreen(CL_Point const & field_coord) const;
private:
	CL_Size sprite_size;
	int step;
	CL_Size field_size;
	CL_Point left_top;
};

#endif // HEADER_POSITION_CALCULATOR_H