Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
2 files changed, 3 insertions, 7 deletions
-rw-r--r--Sem. 13/ShapeCollection/ShapeCollection.cpp4
-rw-r--r--Utils/k_2_SI/task2/EventManager/EventManager.cpp6
diff --git a/Sem. 13/ShapeCollection/ShapeCollection.cpp b/Sem. 13/ShapeCollection/ShapeCollection.cpp
index babe36d..1239fbf 100644
--- a/Sem. 13/ShapeCollection/ShapeCollection.cpp
+++ b/Sem. 13/ShapeCollection/ShapeCollection.cpp
@@ -13,7 +13,7 @@ void ShapeCollection::free()
}
void ShapeCollection::copyFrom(const ShapeCollection& other)
{
- shapes = new Shape* [other.shapesCount];
+ shapes = new Shape* [other.capacity];
shapesCount = other.shapesCount;
capacity = other.capacity;
@@ -99,4 +99,4 @@ double ShapeCollection::getIfPointInShapeByIndex(size_t ind, int x, int y) const
if (ind >= shapesCount)
throw std::out_of_range("Out of range in shapes collection");
return shapes[ind]->isPointIn(x, y);
-} \ No newline at end of file
+}
diff --git a/Utils/k_2_SI/task2/EventManager/EventManager.cpp b/Utils/k_2_SI/task2/EventManager/EventManager.cpp
index 78a22c6..edc61dd 100644
--- a/Utils/k_2_SI/task2/EventManager/EventManager.cpp
+++ b/Utils/k_2_SI/task2/EventManager/EventManager.cpp
@@ -18,9 +18,7 @@ void EventManager::copyFrom(const EventManager& other)
capacity = other.capacity;
for (size_t i = 0; i < eventsCount; i++)
- {
events[i] = other.events[i]->clone();
- }
}
void EventManager::resize()
@@ -70,13 +68,11 @@ void EventManager::addEvent(Event* event)
void EventManager::addEventTypeA(size_t startH, size_t startM, size_t endH, size_t endM, const char* name)
{
//validation
-
addEvent(new EventTypeA(startH, startM, endH, endM, name));
}
void EventManager::addEventTypeB(size_t startH, size_t startM, size_t breakH, size_t breakM, size_t endH, size_t endM)
{
//validation
-
addEvent(new EventTypeB(startH, startM, endH, endM, breakH, breakM));
}
void EventManager::addEventTypeC(size_t startH, size_t startM, size_t break1H, size_t break1M, size_t break2H, size_t break2M)
@@ -107,4 +103,4 @@ Event::EventType EventManager::getType(size_t ind) const
if (ind >= eventsCount)
throw std::out_of_range("Out of range");
return events[ind]->getType();
-} \ No newline at end of file
+}