Sista v3.0.0-alpha.1
Sista is a C++ lightweight OS-agnostic library for terminal animations and videogames
|
Implementation of the field management functionalities of the Sista library. More...
Namespaces | |
namespace | sista |
Sista library namespace. | |
Implementation of the field management functionalities of the Sista library.
This file contains the implementation of the Field class and its methods for managing a 2D grid of Pawns. It includes methods for adding, removing, moving, and printing Pawns, as well as checking the state of the field (e.g., occupancy, bounds). The Field class uses std::shared_ptr
for managing Pawn objects to ensure proper memory management and avoid memory leaks. The implementation also includes the SwappableField subclass, which extends Field to handle scenarios where multiple Pawns may need to swap positions.