From 9ba0df95eb1651520eb50efa388693dc34b4ecf8 Mon Sep 17 00:00:00 2001 From: IgorekLoschinin Date: Thu, 16 Sep 2021 21:54:32 +0300 Subject: [PATCH] ref #97 Added objects in testworld. --- src/CrawlTestLvl/private/groupobjbox.cpp | 19 +++++++++++++++++-- src/CrawlTestLvl/private/groupobjbox.h | 7 ++++++- src/CrawlTestLvl/private/world.cpp | 9 ++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/CrawlTestLvl/private/groupobjbox.cpp b/src/CrawlTestLvl/private/groupobjbox.cpp index 38e7f1e..3c48aaf 100644 --- a/src/CrawlTestLvl/private/groupobjbox.cpp +++ b/src/CrawlTestLvl/private/groupobjbox.cpp @@ -11,11 +11,26 @@ namespace TestLvl { -GroupObjBox::GroupObjBox() { +GroupObjBox::GroupObjBox(): CRAWL::IWorldItem("GroupObjBox") { - setDistance(10); + setDistance(2); changeLayout(CRAWL::Refresh::CIRCLE); + add(new GroupObjboxItem); + add(new GroupObjboxItem); + add(new GroupObjboxItem); + add(new GroupObjboxItem); + add(new GroupObjboxItem); + +} + +void GroupObjBox::render(unsigned int tbfMsec) +{ + +} + +void GroupObjBox::init() +{ } diff --git a/src/CrawlTestLvl/private/groupobjbox.h b/src/CrawlTestLvl/private/groupobjbox.h index 0af83a2..dccb9ae 100644 --- a/src/CrawlTestLvl/private/groupobjbox.h +++ b/src/CrawlTestLvl/private/groupobjbox.h @@ -13,10 +13,15 @@ namespace TestLvl { -class GroupObjBox: public CRAWL::ControlPos { +class GroupObjBox: public CRAWL::ControlPos, public CRAWL::IWorldItem { public: GroupObjBox(); + + // IRender interface +public: + void render(unsigned int tbfMsec); + void init(); }; } diff --git a/src/CrawlTestLvl/private/world.cpp b/src/CrawlTestLvl/private/world.cpp index 7bf6964..5d60741 100644 --- a/src/CrawlTestLvl/private/world.cpp +++ b/src/CrawlTestLvl/private/world.cpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace TestLvl { @@ -36,7 +37,13 @@ CRAWL::WorldRule *World::initWorldRules() { {registerObject(), 1}, {registerObject(), 1}, - {registerObject(), 1}}} + {registerObject(), 1}}}, + {2, + { + {registerObject(),20} + } + }, + }; }