-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor code
- Loading branch information
David Arutiunian
committed
Dec 20, 2017
1 parent
0642515
commit 264c0e1
Showing
9 changed files
with
105 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "SFML/Graphics.hpp" | ||
#include "View.h" | ||
|
||
View::View() | ||
{ | ||
m_view.setViewport(sf::FloatRect(0, 0, 1, 1)); | ||
} | ||
|
||
void View::followTo(const std::shared_ptr<Doodler> p_doodler) | ||
{ | ||
m_view.setCenter(p_doodler->getPosition()); | ||
} | ||
|
||
const sf::View &View::getView() const | ||
{ | ||
return m_view; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef DOODLE_JUMP_VIEW_H | ||
#define DOODLE_JUMP_VIEW_H | ||
|
||
#include <SFML/Graphics.hpp> | ||
#include "Doodler.h" | ||
|
||
class View | ||
{ | ||
public: | ||
View(); | ||
|
||
const sf::View &getView() const; | ||
|
||
void followTo(std::shared_ptr<Doodler> p_doodler); | ||
|
||
private: | ||
sf::View m_view; | ||
}; | ||
|
||
#endif //DOODLE_JUMP_VIEW_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters