1
0

」 feat(Ex01): Finished

This commit is contained in:
2024-12-06 16:06:57 +01:00
parent c80c06d354
commit 0682096484
28 changed files with 603 additions and 29 deletions

View File

@ -1,16 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* animal.cpp :+: :+: :+: */
/* Animal.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:14:27 by adjoly #+# #+# */
/* Updated: 2024/12/04 13:37:30 by adjoly ### ########.fr */
/* Updated: 2024/12/06 15:52:01 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "animal.hpp"
#include "Animal.hpp"
Animal::Animal(void) {
log("", "Animal", "", "construtor called");

View File

@ -1,16 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cat.cpp :+: :+: :+: */
/* Cat.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:49:11 by adjoly #+# #+# */
/* Updated: 2024/12/01 20:18:55 by adjoly ### ########.fr */
/* Updated: 2024/12/06 15:52:10 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "cat.hpp"
#include "Cat.hpp"
Cat::Cat(void) : Animal("Cat"){
log("", "Cat", "", "construtor called");

View File

@ -1,18 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cat.hpp :+: :+: :+: */
/* Cat.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:06:08 by adjoly #+# #+# */
/* Updated: 2024/12/01 20:18:42 by adjoly ### ########.fr */
/* Updated: 2024/12/06 15:52:20 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "animal.hpp"
#include "Animal.hpp"
class Cat : public Animal {
public:

View File

@ -1,16 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* dog.cpp :+: :+: :+: */
/* Dog.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 20:05:21 by adjoly #+# #+# */
/* Updated: 2024/12/04 14:01:24 by adjoly ### ########.fr */
/* Updated: 2024/12/06 15:52:26 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "dog.hpp"
#include "Dog.hpp"
Dog::Dog(void) : Animal("Dog"){
log("", "Dog", "", "construtor called");

View File

@ -1,18 +1,18 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* dog.hpp :+: :+: :+: */
/* Dog.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 20:06:20 by adjoly #+# #+# */
/* Updated: 2024/12/01 20:18:35 by adjoly ### ########.fr */
/* Updated: 2024/12/06 15:52:35 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "animal.hpp"
#include "Animal.hpp"
class Dog : public Animal {
public:

View File

@ -6,13 +6,13 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:49:11 by adjoly #+# #+# */
/* Updated: 2024/12/04 13:49:51 by adjoly ### ########.fr */
/* Updated: 2024/12/06 15:55:37 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "WrongCat.hpp"
WrongCat::WrongCat(void) : Animal("WrongCat"){
WrongCat::WrongCat(void) : WrongAnimal("WrongCat"){
log("", "WrongCat", "", "construtor called");
}
@ -20,7 +20,7 @@ WrongCat::~WrongCat(void) {
log("", "WrongCat", "", "destructor called");
}
WrongCat::WrongCat(const WrongCat &cpy) : Animal("WrongCat"){
WrongCat::WrongCat(const WrongCat &cpy) : WrongAnimal("WrongCat"){
log("", "WrongCat", _type, "copy construtor called");
*this = cpy;
}

View File

@ -6,15 +6,15 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:06:08 by adjoly #+# #+# */
/* Updated: 2024/12/04 13:49:47 by adjoly ### ########.fr */
/* Updated: 2024/12/06 15:55:47 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "animal.hpp"
#include "WrongAnimal.hpp"
class WrongCat : public Animal {
class WrongCat : public WrongAnimal {
public:
WrongCat(void);
~WrongCat(void);

View File

@ -6,14 +6,13 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/30 16:21:28 by adjoly #+# #+# */
/* Updated: 2024/12/04 13:56:06 by adjoly ### ########.fr */
/* Updated: 2024/12/06 16:02:36 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "WrongAnimal.hpp"
#include "cat.hpp"
#include "dog.hpp"
#include <iostream>
#include "Cat.hpp"
#include "Dog.hpp"
int main() {
{
@ -21,7 +20,6 @@ int main() {
const Animal* dog = new Dog();
const Animal* cat = new Cat();
log("", "Animal/Cat", "Type", cat->getType());
log("", "Animal/Dog", "Type", dog->getType());
cat->makeSound(); //will output the cat sound!