#pragma once #include #include #include "common/basicTypes.h" /* template */ /* Vec& operator+=(Vec& lhs, Vec&& rhs) // Combine 2 vectors */ /* { */ /* lhs.reserve(lhs.size() + rhs.size()); */ /* for(auto&& el: rhs) */ /* lhs.push_back( std::move(el) ); */ /* return lhs; */ /* } */ /* template */ /* Vec& operator+=(Vec& lhs, const Vec& rhs) // Combine 2 vectors */ /* { */ /* lhs.reserve(lhs.size() + rhs.size()); */ /* for(const auto& el: rhs) */ /* lhs.push_back(el); */ /* return lhs; */ /* } */ template void remove(Vec& vec, size_t pos) /* Remove from vector by moving the last element in its place */ { vec[pos] = vec[vec.size() - 1]; vec.pop_back(); } inline I32 min(I32 a, I32 b) { return a <= b ? a : b; } inline I32 max(I32 a, I32 b) { return a >= b ? a : b; } /* wheather a pad with the given coordinates will be visible */ bool willBeVisible(I16 drawY, I16 drawX, U16 height, U16 width); /* like pnoutrefresh but pminrow,col are calculated based on width,height and top left coords, which can be negative (outside the screen) */ void drawpad(WINDOW* pad, I16 drawY, I16 drawX);