Skip to content
Permalink
Browse files
db conn
  • Loading branch information
mockk committed Mar 7, 2019
2 parents 56e178b + 08c8533 commit 8d36b49711bc2a2161b7377387b83db3315641ff
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 62 deletions.

This file was deleted.

BIN +72 KB (100%) cocktail-db.db
Binary file not shown.
Empty file.
@@ -81,6 +81,8 @@ int main()

initialiseObjectsFromDatabase(db);

//for the mouse to work on whole screen (https://stackoverflow.com/questions/47256750/how-to-build-curses-program-that-supports-more-than-223-columns-of-mouse-input)
setenv("TERM","xterm-1005",1);
//ncurses start
initscr();
//do not show user input
@@ -146,18 +148,24 @@ int main()
Timer timer = Timer(5*60);


/*
**************************************
LOGO WINDOW
**************************************
*/

WINDOW * text = newwin(8, 70, 0, (xMax-70)/2);
//box(text, 0,0);
refresh();
wrefresh(text);

string thiss = "( \
:::::::: ::: ::: ::: ::: ::: :::::::::: \
:+: :+: :+: :+: :+: :+: :+: :+: :+: \
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ \
+#++:++#++ +#++:++#++ +#++:++#++: +#++:++ +#++:++# \
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ \
#+# #+# #+# #+# #+# #+# #+# #+# #+# \
string thiss = R"(
:::::::: ::: ::: ::: ::: ::: ::::::::::
:+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#++:++#++ +#++:++#++ +#++:++#++: +#++:++ +#++:++#
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ### ### ### ### ### ### ##########)" ;


@@ -185,19 +193,13 @@ int main()

mvwprintw(recipeBook, 1, 1, "<-- RECIPE BOOK -->");

WINDOW * recipeBook2 = newwin(20, 30, 15, xMax-33);
WINDOW * recipeBook2 = newwin(21, 30, 15, xMax-33);
box(recipeBook2,0,0);
refresh();
wrefresh(recipeBook2);

wbkgd(recipeBook2, COLOR_PAIR(3));

mvwprintw(recipeBook2, 1, 10, "Bloody Mary");
mvwprintw(recipeBook2, 3, 1, "Tall glass");
mvwprintw(recipeBook2, 4, 1, "Tomato Juice");
mvwprintw(recipeBook2, 5, 1, "Vodka");


wrefresh(recipeBook);
wrefresh(recipeBook2);

@@ -218,7 +220,7 @@ int main()

wrefresh(ingredientsWindow);

WINDOW * ingr2 = newwin( 20, WIN_X, 15, 3);
WINDOW * ingr2 = newwin( 21, WIN_X, 15, 3);
box(ingr2, 0, 0);
refresh();
wrefresh(ingr2);
@@ -240,7 +242,7 @@ int main()
**************************************
*/

WINDOW * glass = newwin( 3, WIN_X, 11, 26);
WINDOW * glass = newwin( 3, WIN_X, 11, 3+WIN_X+2);
box(glass, 0, 0);
refresh();
wrefresh(glass);
@@ -251,7 +253,7 @@ int main()

wrefresh(glass);

WINDOW * glass2 = newwin( 20, WIN_X, 15, WIN_X+5);
WINDOW * glass2 = newwin( 21, WIN_X, 15, WIN_X+5);
box(glass2, 0, 0);
refresh();
wrefresh(glass2);
@@ -279,7 +281,9 @@ int main()

mvwprintw(decoration, 1, (WIN_X-11)/2, "DECORATIONS");

WINDOW * dec2 = newwin( 20, WIN_X, 15, 5+2*WIN_X+2);
wrefresh(decoration);

WINDOW * dec2 = newwin( 21, WIN_X, 15, 5+2*WIN_X+2);
box(dec2, 0, 0);
refresh();
wrefresh(dec2);
@@ -321,7 +325,7 @@ int main()
**************************************
*/

WINDOW * Customer = newwin(13, ((WIN_X*3+4)-4)/2, 37,3);
WINDOW * Customer = newwin(13, ((WIN_X*3+4)-4)/2, 38,3);

refresh();

@@ -338,11 +342,11 @@ int main()

/*
**************************************
COCKTAIL WINDOW
COCKTAIL SHAKER WINDOW
**************************************
*/

WINDOW * Shaker = newwin(13, (WIN_X*3+4)/2+1, 37, 3+(WIN_X*3+4)/2);
WINDOW * Shaker = newwin(13, (WIN_X*3+4)/2+1, 38, 3+(WIN_X*3+4)/2);

box(Shaker,0,0);
refresh();
@@ -363,7 +367,7 @@ int main()
**************************************
*/

WINDOW * title = newwin(7, 35, 37, xMax-38);
WINDOW * title = newwin(7, 35, 38, xMax-38);
refresh();
box(title,0,0);
wbkgd(title,COLOR_PAIR(4));
@@ -478,7 +482,7 @@ int main()

int moneyVal = 0;

WINDOW * money = newwin( 5, 35, 45, xMax-38);
WINDOW * money = newwin( 5, 35, 46, xMax-38);
box(money, 0, 0);

wbkgd(money,COLOR_PAIR(2));
@@ -539,7 +543,7 @@ int main()
{
getAndPrint(dec2, Shaker, event.y, shakerContent);
}
if(event.x>2+3*WIN_X && event.x<6+3*WIN_X && event.y==38) //clr button
if(event.x>2+3*WIN_X && event.x<6+3*WIN_X && event.y==39) //clr button
{
shakerContent.clear();
for (int i = 2; i<11 ; i++)
@@ -549,7 +553,7 @@ int main()
wrefresh(Shaker);

}
if(event.x>xMax-38 && event.x<xMax-23 && event.y>37 && event.y<43 || (event.x==161 && event.y <109)) //shake button
if(event.x>xMax-38 && event.x<xMax-23 && event.y>39 && event.y<44 || (event.x==161 && event.y <109)) //shake button
{
mvwprintw(Shaker, 10, 1, "shook");
wrefresh(Shaker);
@@ -559,7 +563,7 @@ int main()
mvwprintw(recipeBook2, 8, 1, "left ");
wrefresh(recipeBook2);
}
if(event.y>xMax-7 && event.y<xMax-3 && event.x == 161) //arrow right
if(event.y>xMax-8 && event.y<xMax-4 && event.x == 161) //arrow right
{
mvwprintw(recipeBook2, 8, 1, "right");
wrefresh(recipeBook2);
@@ -0,0 +1,4 @@
all: interface

interface: interface.cpp
g++ -std=c++14 interface.cpp -o interface -lncurses -lsqlite3
BIN +62 KB randBev
Binary file not shown.
@@ -0,0 +1,18 @@
#include <iostream>
#include <string>
#include "randBev.h"
#include "db.h"
#include <vector>
#include "dbcon.h"
using namespace std;

int output()
{
vector<string> bev = read();
if (bev.size()!=0)
{
cout << "I want " << randChoice(bev) << " pls!" << endl;
return 0;
}
return 1;
}
@@ -9,6 +9,10 @@ using namespace std;
int main()
{
vector<string> bev = read();
cout << "I want " << randChoice(bev) << " pls!" << endl;
return 0;
if (bev.size()!=0)
{
cout << "I want " << randChoice(bev) << " pls!" << endl;
return 0;
}
return 1;
}

0 comments on commit 8d36b49

Please sign in to comment.