Minesweeper2  V1.1.1 Game in C++ by Górka Mateusz
Field.hpp File Reference
#include "FieldCode.hpp"
#include <cstdint>
#include <iostream>

Go to the source code of this file.

Classes

class  Field
 Field of the board. More...
 

Functions

std::ostream & operator<< (std::ostream &strm, const Field &field)
 Operator to display a field information. More...
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  strm,
const Field field 
)

Operator to display a field information.

Parameters
strm- ostream
field- field
Returns
std::ostream& - ostream
4  {
5  strm << '[' << (field.flagged() ? 'f' : '_') << (field.covered() ? 'c' : 'u')
6  << (int) field.val() << ']';
7  return strm;
8 }
Field::covered
bool covered() const
Is field covered? (is covered)
Definition: Field.hpp:126
Field::flagged
bool flagged() const
Is field flagged? ** flagged field is covered! **.
Definition: Field.hpp:109
Field::val
uint8_t val() const
Return value of field.
Definition: Field.hpp:72