FastEngine 0.9.4
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
fge::BooleanFlag Class Reference

A class to handle a boolean flag. More...

#include <C_flag.hpp>

Public Member Functions

constexpr BooleanFlag (bool defaultValue=false)
constexpr bool check (bool input)
 Check the input and return the flag value.
constexpr void set (bool value)
 Manually set the flag value.
constexpr bool get () const
 Get the flag value.
constexpr bool operator= (bool value)
 Manually set the flag value operator.
constexpr operator bool () const
 Get the flag value operator.

Detailed Description

A class to handle a boolean flag.

A flag becomes true only once when the input is held true and then waits for the input to return to false before being set again.

Member Function Documentation

◆ check()

bool fge::BooleanFlag::check ( bool input)
inlineconstexpr

Check the input and return the flag value.

This function will only return true once, and wait for the input to return false before being set again.

Parameters
inputThe boolean input to check
Returns
The flag value

◆ get()

bool fge::BooleanFlag::get ( ) const
inlinenodiscardconstexpr

Get the flag value.

Returns
The flag value

◆ operator bool()

fge::BooleanFlag::operator bool ( ) const
inlineconstexpr

Get the flag value operator.

Returns
The flag value

◆ operator=()

bool fge::BooleanFlag::operator= ( bool value)
inlineconstexpr

Manually set the flag value operator.

Parameters
valueThe boolean value to set
Returns
The flag value

◆ set()

void fge::BooleanFlag::set ( bool value)
inlineconstexpr

Manually set the flag value.

Parameters
valueThe boolean value to set

The documentation for this class was generated from the following file: