Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a favorites menu.
- Loading branch information
Showing
14 changed files
with
137 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "Favorite.h" | ||
#include <algorithm> | ||
|
||
std::vector<std::string> *favoritesList; | ||
|
||
Favorite::Favorite() | ||
{ | ||
favoritesList = new std::vector<std::string>(); | ||
} | ||
|
||
|
||
std::vector<std::string> *Favorite::GetFavoritesList() | ||
{ | ||
return favoritesList; | ||
} | ||
|
||
void Favorite::SetFavoritesList(std::vector<std::string> newFavoritesList) | ||
{ | ||
*favoritesList = newFavoritesList; | ||
} | ||
|
||
bool Favorite::IsFavorite(std::string identifier) | ||
{ | ||
std::vector<std::string> tempFavoritsList = *favoritesList; | ||
return std::find(tempFavoritsList.begin(), tempFavoritsList.end(), identifier) != tempFavoritsList.end(); | ||
} |
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,16 @@ | ||
#ifndef FAVORITE_H | ||
#define FAVORITE_H | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "common/Singleton.h" | ||
|
||
class Favorite : public Singleton<Favorite> { | ||
public: | ||
Favorite(); | ||
std::vector<std::string> * GetFavoritesList(); | ||
void SetFavoritesList(std::vector<std::string> favoritesList); | ||
bool IsFavorite(std::string identifier); | ||
}; | ||
#endif //FAVORITE_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
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 |
---|---|---|
|
@@ -45,6 +45,11 @@ class Menu | |
{ | ||
tools.push_back(tool_); | ||
} | ||
|
||
void ClearTools() | ||
{ | ||
tools.clear(); | ||
} | ||
}; | ||
|
||
|
||
|
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