Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit30601882aa51c1c6aa646c3bb6001f2c848adde7 (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2022-06-06 10:43:08 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2022-06-06 10:43:08 +0300
Filesaee8be92c584b6d54ffc93a42f9f1728bc21731e
Object-oriented_programming_FMI-30601882aa51c1c6aa646c3bb6001f2c848adde7.tar
Object-oriented_programming_FMI-30601882aa51c1c6aa646c3bb6001f2c848adde7.tar.gz
Object-oriented_programming_FMI-30601882aa51c1c6aa646c3bb6001f2c848adde7.zip
Parentc8430b4df4fae035bab0221385d5f538769aa7fc (diff)
Parent5c6da013a652b41281a01b16e028a03c15642172 (diff)
Merge branch 'master' of https://github.com/Angeld55/Object-oriented_programming_FMI
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
+}