Skip to content
Snippets Groups Projects
Commit 4992796e authored by Joakim Hunskaar's avatar Joakim Hunskaar
Browse files

added pdf and handout Ø8

parent da1afc79
No related branches found
No related tags found
No related merge requests found
File added
#include "Car.h"
#include <cassert>
// BEGIN 1b
// END 1b
// BEGIN 1c
// END 1c
\ No newline at end of file
#pragma once
// BEGIN: 1a
// END: 1a
\ No newline at end of file
#include "Meeting.h"
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
// BEGIN 3b
// END 3b
// BEGIN 3e
// END 3e
// BEGIN 3f
// END 3f
// BEGIN 3h
// END 3h
// BEGIN 3i
// END 3i
// BEGIN 3j
// END 3j
#pragma once
#include "Person.h"
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <unordered_map>
// BEGIN 3a
enum class Campus {};
// END 3a
// BEGIN 3b
// END 3b
// FJERN KOMMENTAR NAAR DU SKAL BRUKE
/*
const std::unordered_map<Campus, std::string> campusToString {
{ Campus::trh, "Trondheim" },
{ Campus::aal, "Aalesund" },
{ Campus::gjo, "Gjovik"}
};
const std::unordered_map<std::string, Campus> stringToCampus {
{ "Trondheim", Campus::trh },
{ "Aalesund", Campus::aal },
{ "Gjovik", Campus::gjo }
};
*/
class Meeting
{
private:
// BEGIN 3c
// END 3c
public:
// BEGIN 3d
// END 3d
// BEGIN 3e
// END 3e
Meeting(int day, int startTime, int endTime, Campus location, const std::string& subject, const std::shared_ptr<Person> leader);
// BEGIN 3h
// END 3h
// BEGIN 3i
// END 3i
// Vi ønsker ikke å tillate kopiering av Meeting-objekter
Meeting(const Meeting&) = delete;
Meeting& operator=(const Meeting&) = delete;
};
// BEGIN 3j
// END 3j
\ No newline at end of file
#include "MeetingWindow.h"
#include <iostream>
MeetingWindow::MeetingWindow(TDT4102::Point position, int width, int height, const std::string& title):
// BEGIN 4a
AnimationWindow{},
// END 4a
// BEGIN 4e
// END 4e
// BEGIN 5a
#define FOUR_A
// END 5a
// BEGIN 5b
#define FOUR_B
// END 5b
dummyArgument{0}
{
// Felles
// BEGIN 4f
// END 4f
// BEGIN 4g
// END 4g
// BEGIN 5d
// END 5d
// Ny person
#ifndef FOUR_A
attachPersonWidget(personName);
attachPersonWidget(personEmail);
#endif
#ifndef FOUR_B
attachPersonWidget(personSeats);
attachPersonWidget(personNewBtn);
#endif
}
// Callbackfunksjoner
// BEGIN 4d
// END 4d
// BEGIN 5c
// END 5c
void MeetingWindow::attachPersonWidget(TDT4102::Widget& pw)
{
add(pw);
personWidgets.emplace_back(std::ref(pw));
}
\ No newline at end of file
#pragma once
#include "AnimationWindow.h"
#include "Meeting.h"
#include "Person.h"
#include "widgets/Button.h"
#include "widgets/TextInput.h"
#include "widgets/DropdownList.h"
#include <string>
#include <vector>
#include <functional>
// Meeting GUI
class MeetingWindow : public TDT4102::AnimationWindow
{
public:
// BEGIN 4c
// END 4c
MeetingWindow(TDT4102::Point position, int width, int height, const std::string& title);
// Avslutt knapp
// BEGIN 4e
// END 4e
// Callback-funksjoner
// BEGIN 4d
// END 4d
// Person
// BEGIN 5a
// END 5a
// BEGIN 5b
// END 5b
// Personer
// BEGIN 5c
// END 5c
int dummyArgument;
// Hjelpefunksjoner og variabler
void attachPersonWidget(TDT4102::Widget& pw);
std::vector<std::reference_wrapper<TDT4102::Widget>> personWidgets;
};
#include "Person.h"
// BEGIN 2b
// END 2b
// BEGIN 2c
// END 2c
// BEGIN 2d
// END 2d
#pragma once
#include "Car.h"
#include <string>
#include <iostream>
#include <memory>
class Person
{
public:
// BEGIN 2b
// END 2b
// BEGIN 2c
// END 2c
// BEGIN 2d
// END 2d
// Vi onsker ikke å tillate kopiering av Person-objekter
Person(const Person&) = delete;
Person& operator=(const Person&) = delete;
private:
// BEGIN 2a
// END 2a
};
#include "Person.h"
#include "Meeting.h"
#include "MeetingWindow.h"
#include <iostream>
int main()
{
// Her kan du teste koden din
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment