Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
Classes | Typedefs | Enumerations | Functions | Variables
Vocabulary

Vocabulary classes. More...

Classes

class  gf::Flags< E >
 Bitfield relying on an enumeration. More...
 
class  gf::Ref< T >
 A reference wrapper. More...
 
class  gf::Singleton< T >
 A singleton that wraps a pointer provided by a storage. More...
 
class  gf::SingletonStorage< T >
 A storage for a singleton. More...
 
class  gf::StaticSpan< T, N >
 A static span. More...
 
class  gf::Span< T >
 A span. More...
 
struct  gf::NoneType
 Semantic type to represent "none". More...
 
struct  gf::AllType
 Semantic type to represent "all". More...
 
struct  gf::AnyType
 Semantic type to represent "any". More...
 
struct  gf::ZeroType
 Semantic type to represent "zero". More...
 

Typedefs

using gf::Id = uint64_t
 An identifier. More...
 

Enumerations

enum class  gf::AngularMove : uint8_t {
  gf::AngularMove::None ,
  gf::AngularMove::Left ,
  gf::AngularMove::Right
}
 An angular move. More...
 
enum class  gf::LinearMove : uint8_t {
  gf::LinearMove::None ,
  gf::LinearMove::Forward ,
  gf::LinearMove::Backward
}
 A linear move. More...
 
enum  gf::Quarter {
  gf::UpperLeft ,
  gf::UpperRight ,
  gf::LowerRight ,
  gf::LowerLeft
}
 A quarter in a square. More...
 

Functions

constexpr Id gf::hash (const char *str, std::size_t sz)
 Get an identifier from a string. More...
 
constexpr Id gf::hash (std::string_view str)
 Get an idenfitier from a string. More...
 
constexpr gf::Id gf::literals::operator""_id (const char *str, std::size_t sz)
 User defined operator for creating compile time ids from strings. More...
 
GF_CORE_API float gf::angularFactor (AngularMove move)
 Get the angular factor from the angular move. More...
 
GF_CORE_API float gf::linearFactor (LinearMove move)
 Get the linear factor from the linear move. More...
 

Variables

constexpr Id gf::InvalidId = 0
 The invalid id (which is 0) More...
 
constexpr NoneType gf::None = { }
 Constant to represent "none". More...
 
constexpr AllType gf::All = { }
 Constant to represent "all". More...
 
constexpr AnyType gf::Any = { }
 Constant to represent "any". More...
 
constexpr ZeroType gf::Zero = { }
 Constant to represent "zero". More...
 

Detailed Description

Vocabulary classes.

Typedef Documentation

◆ Id

using gf::Id = typedef uint64_t

An identifier.

Enumeration Type Documentation

◆ AngularMove

enum class gf::AngularMove : uint8_t
strong

An angular move.

An angular move represents a rotation move to the right or to the left.

See also
gf::LinearMove
Enumerator
None 

No angular move.

Left 

Move to the left (i.e. counter-clockwise)

Right 

Move to the right (i.e. clockwise)

◆ LinearMove

enum class gf::LinearMove : uint8_t
strong

A linear move.

A linear move represents a translation move forward or backward.

See also
gf::AngularMove
Enumerator
None 

No linear move.

Forward 

Move forward.

Backward 

Move backward.

◆ Quarter

A quarter in a square.

Enumerator
UpperLeft 

Upper-left quarter.

UpperRight 

Upper-right quarter.

LowerRight 

Lower-right quarter.

LowerLeft 

Lower-left quarter.

Function Documentation

◆ angularFactor()

GF_CORE_API float gf::angularFactor ( AngularMove  move)

Get the angular factor from the angular move.

Returns
\( -1 \), \( 0 \) or \( 1 \) with respect to the move

◆ hash() [1/2]

constexpr Id gf::hash ( const char *  str,
std::size_t  sz 
)
constexpr

Get an identifier from a string.

The hash is a Fowler–Noll–Vo 1a hash. This function is mainly for internal use. You should instead use the user-defined literal _id.

Example:

gf::Id id = "A string"_id; // computed at compile time
uint64_t Id
An identifier.
Definition: Id.h:37
Parameters
strThe string
szThe size of the string

◆ hash() [2/2]

constexpr Id gf::hash ( std::string_view  str)
constexpr

Get an idenfitier from a string.

The hash is a Fowler–Noll–Vo 1a hash. This function can be used for computing an id at runtime. For computing an id from a string at compile time, you should use the the user-defined literal _id.

Parameters
strThe string
Returns
The hash of the string

◆ linearFactor()

GF_CORE_API float gf::linearFactor ( LinearMove  move)

Get the linear factor from the linear move.

Returns
\( -1 \), \( 0 \) or \( 1 \) with respect to the move

◆ operator""_id()

constexpr gf::Id gf::literals::operator""_id ( const char *  str,
std::size_t  sz 
)
constexpr

User defined operator for creating compile time ids from strings.

To use it, you have to use the gf::literals namespace:

using namespace gf::literals;
Id id = "FooBar"_id;
The namespace for literals.

Variable Documentation

◆ All

constexpr AllType gf::All = { }
constexpr

Constant to represent "all".

See also
gf::AllType, gf::None

◆ Any

constexpr AnyType gf::Any = { }
constexpr

Constant to represent "any".

See also
gf::AnyType, gf::All, gf::None

◆ InvalidId

constexpr Id gf::InvalidId = 0
constexpr

The invalid id (which is 0)

◆ None

constexpr NoneType gf::None = { }
constexpr

Constant to represent "none".

See also
gf::NoneType, gf::All

◆ Zero

constexpr ZeroType gf::Zero = { }
constexpr

Constant to represent "zero".

See also
gf::ZeroType