-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsv.h
More file actions
44 lines (30 loc) · 1.1 KB
/
Copy pathcsv.h
File metadata and controls
44 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _CSV_H_
#define _CSV_H_
#include <sstream>
#include <fstream>
#include <climits>
#include <iostream>
#include "turnipexception.h"
#include "sellprice.h"
#include "turnip.h"
#include "typedefs.h"
const int PREVIOUS_WEEK_PATTERN_COL_IDX = 0;
const int FIRST_TIME_BUY_COL_IDX = 1;
const int DAISY_MAE_BASE_PRICE_COL_IDX = 2;
const int SELL_PRICE_START_COL_IDX = 3;
const int SELL_PRICE_LAST_COL_IDX = 12 + SELL_PRICE_START_COL_IDX - 1;
// read in turnips csv
Table readCsv(std::string &file);
// validate daisy mae price and turnip sell prices
bool validateTurnips(Table & t);
// convert read in csv to turnips and the csv MUST BE VALID
// only use this if validateTurnips returns true
std::vector<Turnip *> tableToTurnip(Table & t);
bool isUnfilledField(int n);
// checks if only one pattern type is among all matched price sequences
bool onlyOnePatternTypeInMatch(MatchMap &m);
std::string percentStr(int n);
std::string minMaxStr(int min, int max);
OutputTable matchMapToTable(MatchMap &m, int prevPat, bool firstBuy);
void writeCsv(int islandNum, MatchMap &matches, int prevPat, bool firstBuy);
#endif