{"id":22438916,"url":"https://github.com/cypri1-dev/42_cpp04","last_synced_at":"2025-03-27T09:23:06.836Z","repository":{"id":261825514,"uuid":"885457218","full_name":"cypri1-dev/42_CPP04","owner":"cypri1-dev","description":"This topic explores polymorphism in C++ with Animal, Dog, and Cat classes, using makeSound to show polymorphic behavior. Animal becomes abstract, enforcing unique behavior for derived classes. Interfaces like ICharacter and IMateriaSource allow for creating reusable magical items and characters, applying deep copy and memory management principles.","archived":false,"fork":false,"pushed_at":"2024-11-18T12:25:12.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T14:18:14.781Z","etag":null,"topics":["42cpp","42projects","cpp","cpp04"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cypri1-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T16:11:09.000Z","updated_at":"2024-11-18T12:25:15.000Z","dependencies_parsed_at":"2024-11-08T17:34:18.470Z","dependency_job_id":null,"html_url":"https://github.com/cypri1-dev/42_CPP04","commit_stats":null,"previous_names":["cypri1-dev/42_cpp04"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP04","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP04/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP04/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cypri1-dev%2F42_CPP04/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cypri1-dev","download_url":"https://codeload.github.com/cypri1-dev/42_CPP04/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245815073,"owners_count":20676860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42cpp","42projects","cpp","cpp04"],"created_at":"2024-12-06T01:12:09.287Z","updated_at":"2025-03-27T09:23:06.811Z","avatar_url":"https://github.com/cypri1-dev.png","language":"C++","readme":"\u003ch1\u003e\u003cimg src=\"https://raw.githubusercontent.com/ayogun/42-project-badges/refs/heads/main/covers/cover-cpp-bonus.png\"\u003e\u003c/h1\u003e\n\n## Description\nThis project introduces polymorphism and interfaces in C++ through an `Animal` class hierarchy, where `Dog` and `Cat` inherit from `Animal`, showcasing polymorphic behavior with the `makeSound()` method. The exercises build on this by adding abstract classes, deep copying, memory management, and interfaces for managing unique attributes and behaviors.\n\n## Exercise 00\nObjectives 🚀:\n- Implement a basic `Animal` class and derive `Dog` and `Cat` classes.\n\nRequirements:\n- Define `Animal` with protected attribute `type`.\n- `Dog` and `Cat` initialize `type` as \"Dog\" or \"Cat\".\n- Create `makeSound()` for each class to produce specific sounds.\n\n## Exercise 01\nObjectives 🚀:\n- Extend `Dog` and `Cat` with unique `Brain` objects.\n\nRequirements:\n- Add a `Brain` class with 100 `std::string` ideas.\n- `Dog` and `Cat` have private `Brain*` attributes, allocated with `new` and deleted on destruction.\n- Ensure deep copying of `Dog` and `Cat` objects.\n\n## Exercise 02\nObjectives 🚀:\n- Make `Animal` an abstract class.\n\nRequirements:\n- Convert `Animal` into an abstract base class, making it non-instantiable.\n- Derived classes like `Dog` and `Cat` remain functional.\n\n## Exercise 03\nObjectives 🚀:\n- Implement interfaces using abstract classes.\n\nRequirements:\n- Create `AMateria` with `clone()` and `use()` as pure virtual methods.\n- Implement `Ice` and `Cure` classes with specific `use` actions.\n- Develop `Character` and `MateriaSource` classes with inventory and item management features.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcypri1-dev%2F42_cpp04","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcypri1-dev%2F42_cpp04","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcypri1-dev%2F42_cpp04/lists"}