#include #include "PlayerMove.h" #include "pc/commcode.h" bool PlayerMove::isValid(pos_t w, pos_t h) const { if (x >= h || y >= w) return false; if ((int)dir >= 4) return false; auto xx = tx(), yy = ty(); if (xx >= h || yy >= w) return false; return true; } pos_t PlayerMove::tx() const { return x + direction_dx[(std::size_t)dir]; } pos_t PlayerMove::ty() const { return y + direction_dy[(std::size_t)dir]; }