「✨」 feat(Ex01): Finished
This commit is contained in:
@ -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");
|
@ -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");
|
@ -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:
|
@ -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");
|
@ -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:
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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!
|
||||
|
Reference in New Issue
Block a user