Dog
+* Objects of type Dog
: Max
, Milo
, Coco
, ...
+
+___
+
+### What is a class?
+
+A class is a type.
+
+
+A class in C++ is slightly different from an actual class 🙂 In C++ (or object-oriented programming in general) a class defines the characteristics of an object:
+
+
+* what properties will this object have (fields)
+* what methods of operation will it have (methods, functions)
+
+___
+
+### Questions
+
+* what properties could a computer
object have?
+* what methods could the computer
have?
+
+```cpp
+class Computer {
+ // fields
+ Processor processor_;
+ Drive drive_;
+ Motherboard motherboard_;
+ GraphicsCard graphics_card_;
+ Memory memory_;
+
+ // methods
+ void run();
+ void restart();
+ void shutdown();
+};
+```
+
+
+___
+
+## Composition, aggregation
+
+Nothing prevents one object from being composed of other objects. In this way, we make the structure of our code more understandable.
+
+Containing one object within another is called composition or aggregation. These are not synonyms, they are two slightly different types of object containment, but that doesn't matter at the moment. For example with a computer:
+
+
+```cpp
+class Computer {
+ Processor processor_;
+ Drive drive_;
+ Motherboard motherboard_;
+ GraphicsCard graphics_card_;
+ Memory memory_;
+ // ...
+};
+```
+
+
+A computer consists (is composed of) of a processor, drive, motherboard, graphics card, memory.
+
+
+___
+
+
+## Class diagram - composition, aggregation
+
+public
, private
+6. constructors
+7. destructors
+8. hermetization
+9. getters
+10. setters
+
+___
+
+### Pre-work
+
+* Read and watch videos on inheritance and polymorphism
+
+___
+
+## Group project
+
+Use the code written during the class. You can also use the code in the [solutions](solutions) directory
+
+Group project. Recommended groups of 5 (4-6 are also ok).
+
+Make a Fork of this repo and the whole project is going to be in the [shm](../shm) directory
+
+Collaborate on one fork with a branch or Pull Requests from your own forks.
+
+___
+
+## Organization of work
+
+To divide tasks and track your status, you can use the [Projects on GitHub](https://github.com/coders-school/object-oriented-programming/projects) tab. You can configure it from the Automated kanban with reviews template.
+
+### Planning
+
+Begin with planning where you create cards for each task in the To Do column. It's best to convert them to Issues. Thanks to this, you can assign to tasks and write comments in them. Also write for each task how many days of work you estimate it for. After finishing planning, please send a link to the `#planning` channel to your project board on GitHub.
+
+### Daily
+
+Update your tasks as you work. Synchronize at the same time every day and talk about the problems.
+
+___
+
+### Code Review
+
+Each task delivery must be preceded by a Code Review by another person from the team (or preferably several) to maintain consistency and cooperation.
+
+### Completion
+
+This project will be developed even further. We expect that, regardless of the number of completed tasks, you will do a Pull Request before June 28 (in Scrum, the team decides how many tasks they can do for a specific date).
+
+___
+
+### Punctation
+
+* Each delivered task is worth 5 points
+* 20 points for all 8 tasks delivered before 6/28/2020 (Sunday) by 11:59 PM
+* no bonus points for delivering only part of tasks before 28/06.
+* 6 points for group work for each person in the group.
+
+___
+
+## Task 1
+
+In class `Cargo` write the comparison operator (`operator==`), which will check if the goods are the same.
+
+___
+
+## Exercise 2
+
+Add getters to the class `Cargo` and an appropriate constructor that will fill all the fields of this class.
+
+___
+
+## Exercise 3
+
+Write a class `Island` which will hold the variable `Coordinates position_` and the appropriate getter.
+
+`Coordinates` class has to determine the coordinates on the map. Write it as well. It should take 2 parameters in the constructor `positionX`, `positionY` and the comparison operator.
+
+
+___
+
+## Task 4
+
+Write a class `Map` that will have `std::vectorpublic
, private
6. konstruktory
7. destruktory
8. hermetyzacja
diff --git a/module1/index.en.html b/module1/index.en.html
new file mode 100644
index 000000000..99ce19bb6
--- /dev/null
+++ b/module1/index.en.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+ void eat() override
+* void sleep() override
+* void makeSound() override
+* void fly() override
+* void swim() override
+
+Overwriting such methods means that we can change their implementations.
+
+
+___
+
+## `override`
+
+```cpp
+class Soundable {
+public:
+ virtual void makeSound() = 0;
+};
+```
+
+```cpp
+class Goose : public Soundable {
+public:
+ void makeSound() override { std::cout << "Honk! Honk!"; }
+};
+```
+
+```cpp
+class Hen : public Soundable {
+public:
+ void makeSound() override { std::cout << "Cluck! Cluck!"; }
+};
+```
+
+```cpp
+class Duck : public Soundable {
+public:
+ void makeSound() override { std::cout << "Quack! Quack!"; }
+};
+```
+
+___
+
+## Common base class
+
+Because the common parent of all classes is the class `Soundable` we can store type pointers in a container `Soundable`.
+
+```cpp
+std::vectorvoid eat() override
+* void sleep() override
+* void makeSound() override
+* void fly() override
+* void swim() override
+
+Overwriting such methods means that we can change their implementations.
+
+
+___
+
+## `override`
+
+```cpp
+class Soundable {
+public:
+ virtual void makeSound() = 0;
+};
+```
+
+```cpp
+class Goose : public Soundable {
+public:
+ void makeSound() override { std::cout << "Honk! Honk!"; }
+};
+```
+
+```cpp
+class Hen : public Soundable {
+public:
+ void makeSound() override { std::cout << "Cluck! Cluck!"; }
+};
+```
+
+```cpp
+class Duck : public Soundable {
+public:
+ void makeSound() override { std::cout << "Quack! Quack!"; }
+};
+```
+
+___
+
+## Common base class
+
+Because the common parent of all classes is the class `Soundable` we can store type pointers in a container `Soundable`.
+
+```cpp
+std::vectorstd::vector
na cppreference.com
+ * Część prywatna (implementacja) jest nieznana
+* Projektowanie zorientowane obiektowo (OOD - Object Oriented Design)
+
+> Make interfaces easy to use correctly and hard to use incorrectly
+>
+> \ - \ - Scott Meyers, [Efektywne C ++](https://blog.ycshao.com/2012/11/23/effective-c-item-18-make-interfaces-easy-to-use-correctly-and-hard-to-use-incorrectly/)
+
+
+___
+
+## Zły przykład interfejsu
+
+```c++
+// A date class which is easy to use but also easy to use wrong.
+class Date {
+ public:
+ Date(int month, int day, int year);
+ ...
+};
+
+// Both are ok, but some european programmer may use it wrong,
+// because european time format is dd/mm/yyyy instead of mm/dd/yyyy.
+Date d(3, 4, 2000);
+Date d(4, 3, 2000);
+```
diff --git a/module4/encapsulation.md b/module4/02_encapsulation.en.md
similarity index 100%
rename from module4/encapsulation.md
rename to module4/02_encapsulation.en.md
diff --git a/module4/02_encapsulation.pl.md b/module4/02_encapsulation.pl.md
new file mode 100644
index 000000000..ae4f27533
--- /dev/null
+++ b/module4/02_encapsulation.pl.md
@@ -0,0 +1,14 @@
+
+
+# Enkapsulacja
+
+___
+
+## Enkapsulacja
+
+* Specyfikatory dostępu
+ * public
- struct
domyślna
+ * protected
+ * private
- class
domyślna
+* Settery i gettery
+* Nienazwane przestrzenie nazw
diff --git a/module4/inheritance.md b/module4/03_inheritance.en.md
similarity index 100%
rename from module4/inheritance.md
rename to module4/03_inheritance.en.md
diff --git a/module4/03_inheritance.pl.md b/module4/03_inheritance.pl.md
new file mode 100644
index 000000000..9894df0f6
--- /dev/null
+++ b/module4/03_inheritance.pl.md
@@ -0,0 +1,27 @@
+
+
+# Dziedziczenie
+
+___
+
+## Dziedziczenie
+
+* Porządek wywoływania konstruktorów i destruktorów
+ * Konstruktory - najpierw klasa bazowa, potem pochodna
+ * ideone.com
+* Problem diamentowy
+ * dziedziczenie wirtualne
+* dziedziczenie class
od struct
jest ...
+ * private
+* dziedziczenie struct
od class
jest ...
+ * public
+
+___
+
+## Modyfikatory dostępu do dziedziczenia
+
+| | public
| protected
| private
|
+| : ------------------------: | : ------------------------------------------------- ------: | : ------------------------------------------------- ------: | : ------------------------------------------------- ----: |
+| **public
** | publiczny | chroniony | prywatny |
+| **protected
** | chroniony | chroniony | prywatny |
+| **private
** | prywatny | prywatny | prywatny |
diff --git a/module4/polymorphism.md b/module4/04_polymorphism.en.md
similarity index 100%
rename from module4/polymorphism.md
rename to module4/04_polymorphism.en.md
diff --git a/module4/04_polymorphism.pl.md b/module4/04_polymorphism.pl.md
new file mode 100644
index 000000000..4bcdc3886
--- /dev/null
+++ b/module4/04_polymorphism.pl.md
@@ -0,0 +1,15 @@
+
+
+# Polimorfizm
+
+___
+
+## Polimorfizm
+
+* Funkcje wirtualne
+* funkcje czysto wirtualne (=0
)
+* Klasy abstrakcyjne
+ * mają co najmniej jedną funkcję czysto wirtualną
+* vtable
i vptr
+ * implementacja polimorfizmu
+ * Konstruktor klasy pochodnej przesłania rekordy klasy bazowej w vtable
diff --git a/module4/exercise_cars.md b/module4/05_exercise_cars.en.md
similarity index 100%
rename from module4/exercise_cars.md
rename to module4/05_exercise_cars.en.md
diff --git a/module4/05_exercise_cars.pl.md b/module4/05_exercise_cars.pl.md
new file mode 100644
index 000000000..69ef42ab1
--- /dev/null
+++ b/module4/05_exercise_cars.pl.md
@@ -0,0 +1,19 @@
+
+
+# Zadanie
+
+___
+
+## Samochody
+
+1. Zaprojektuj odpowiednią abstrakcję (interfejsy)
+2. Zastosuj dziedziczenie
+3. Napraw hermetyzację
+4. Użyj polimorfizmu, aby przedstawić każdy typ samochodu za pomocą jednego wskaźnika
+5. Napraw problem diamentowy
+6. Napraw potencjalne wycieki pamięci
+7. Pomyśl o sposobie przechowywania silników w samochodach. Czy powinny być przechowywane przez wartość, referencję czy wskaźnik (jaki rodzaj wskaźnika)?
+8. Czy ten kod można przetestować?
+
+### [Wyświetl zadanie w repozytorium](https://github.com/coders-school/Cars.git)
+
diff --git a/module4/post_work.md b/module4/06_post_work.en.md
similarity index 100%
rename from module4/post_work.md
rename to module4/06_post_work.en.md
diff --git a/module4/06_post_work.pl.md b/module4/06_post_work.pl.md
new file mode 100644
index 000000000..d181940cc
--- /dev/null
+++ b/module4/06_post_work.pl.md
@@ -0,0 +1,17 @@
+
+
+# Post-work
+
+___
+
+## Post-work
+
+Możesz pracować w grupach lub indywidualnie. Zrób forka repozytorium Cars i Pull Requesta po zakończeniu.
+
+1. (4 XP) Utwórz wyjątek InvalidGear
. Należy go rzucić, gdy ktoś próbuje np. zmienić bieg z 5 na wsteczny. Powinien dziedziczyć z jednego z wyjątków STL
+2. (2 XP za każdą poprawkę) Napraw interfejsy, aby były łatwe w użyciu, poprawne i trudne w użyciu nieprawidłowo (np. accelerate(-999)
)
+3. (10 XP - opcjonalnie) Napisz odpowiednie testy jednostkowe do tego kodu
+4. Przeczytaj jeden z poniższych artykułów. Przyda się na następną lekcję
+
+ * SOLID czyli dobre praktyki w programowaniu obiektowym (po polsku)
+ * S.O.L.I.D: The First 5 Principles of Object Oriented Design (po angielsku)
diff --git a/module4/index.html b/module4/index.en.html
similarity index 88%
rename from module4/index.html
rename to module4/index.en.html
index 2b02a08c5..f24101b92 100644
--- a/module4/index.html
+++ b/module4/index.en.html
@@ -69,25 +69,25 @@