diff options
Diffstat (limited to 'cpp04/ex01/main.cpp')
| -rw-r--r-- | cpp04/ex01/main.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/cpp04/ex01/main.cpp b/cpp04/ex01/main.cpp new file mode 100644 index 0000000..6798b57 --- /dev/null +++ b/cpp04/ex01/main.cpp @@ -0,0 +1,43 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/14 09:05:58 by charles #+# #+# */ +/* Updated: 2020/04/14 14:09:51 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Character.hpp" +#include "RadScorpion.hpp" +#include "PlasmaRifle.hpp" +#include "PowerFist.hpp" + +int main() +{ + Character* me = new Character("me"); + + std::cout << *me; + + Enemy* b = new RadScorpion(); + + AWeapon* pr = new PlasmaRifle(); + AWeapon* pf = new PowerFist(); + + me->equip(pr); + std::cout << *me; + me->equip(pf); + + me->attack(b); + std::cout << *me; + me->equip(pr); + std::cout << *me; + me->attack(b); + std::cout << *me; + me->attack(b); + std::cout << *me; + + return 0; +} |
