This commit is contained in:
DarthMooMancer
2025-09-29 20:29:13 -04:00
parent 8f88b401a8
commit a4dbb853c8
6 changed files with 19 additions and 27 deletions
+2 -8
View File
@@ -1,4 +1,3 @@
#include <iostream>
#include "elements.hpp"
#include "globals.hpp"
@@ -7,23 +6,18 @@ Point::Point() {
m_col = 0;
}
void Point::to_string() {
std::cout << "(" << m_row << ", " << m_col << ")\n";
}
void Point::assign(int row, int col) {
m_row = row;
m_col = col;
}
Paddle create_new_paddle(Point** segments, int index, int size, int row, char symbol) {
Paddle create_new_paddle(Point** buffer, int starting_array_index, int size, int row, char symbol) {
Paddle paddle { size };
paddle._size = size;
paddle.m_nodes = new Point*[size];
for(int i = 0; i < size; i++) {
paddle.m_nodes[i] = new Point { row, ((COL / 2) - (size / 2)) + i, symbol };
// paddle.m_nodes[i] = new Point { row, ((COL / 2) - (size / 2) - 1) + i, symbol };
segments[i + index] = paddle.m_nodes[i];
buffer[i + starting_array_index] = paddle.m_nodes[i];
}
return paddle;