wip
This commit is contained in:
+2
-8
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user