Gamedev Framework (gf)  0.12.0
A C++14 framework for 2D games
Classes | Typedefs | Enumerations | Variables
Game classes

All the classes related to game systems and game entities. More...

Classes

class  gf::ValueActivity
 An activity for a simple float value. More...
 
class  gf::RotateToActivity
 An activity for a change of angle. More...
 
class  gf::MoveToActivity
 An activity for a change of position. More...
 
class  gf::ColorActivity
 An activity for a change of color. More...
 
class  gf::CallbackActivity
 An activity for calling a function once. More...
 
class  gf::DelayActivity
 An activity to wait for a predefined duration. More...
 
class  gf::SequenceActivity
 An activity to run several activities sequentially. More...
 
class  gf::RepeatActivity
 An activity to run an activity several times. More...
 
class  gf::RepeatedSequenceActivity
 A repeated sequence activity. More...
 
class  gf::ParallelActivity
 An activity to run several activities in parallel. More...
 
class  gf::Activity
 A game activity. More...
 
class  gf::AssetManager
 An asset manager. More...
 
struct  gf::Penetration
 Data about the collision between two objects. More...
 
class  gf::Console
 A virtual console. More...
 
struct  gf::ConsoleChar
 Named console characters. More...
 
struct  gf::ConsoleFontFormat
 A console font format. More...
 
struct  gf::ConsoleFontElement
 A console font element. More...
 
struct  gf::PredefinedConsoleFontFormat
 Predefined console font formats. More...
 
class  gf::ConsoleFont
 A console font. More...
 
class  gf::BitmapConsoleFont
 A bitmap console font. More...
 
class  gf::ColoredConsoleFont
 A colored console font. More...
 
class  gf::Entity
 A game entity. More...
 
class  gf::EntityContainer
 A collection of entities. More...
 
class  gf::SquareMap
 A square map. More...
 
struct  gf::Message
 The base class for all messages. More...
 
class  gf::MessageManager
 A message manager. More...
 
class  gf::Model
 A game object that can be updated. More...
 
class  gf::ModelContainer
 A collection of models. More...
 
class  gf::FixedTimestepModel
 Fixed timestep model. More...
 
class  gf::PhysicsBody
 A physics body. More...
 
class  gf::PhysicsGeometry
 The geometry of a physics body. More...
 
class  gf::PhysicsModel
 A model for physics simulation. More...
 
class  gf::RandomBinaryTree::Node
 A node of the random binary space partionning tree. More...
 
class  gf::RandomBinaryTree
 A random binary space partionning tree. More...
 
class  gf::ResourceCache< T >
 A generic cache for resources. More...
 
class  gf::ResourceManager
 A resource manager. More...
 
class  gf::Serializer
 A serializer to a binary file. More...
 
class  gf::Deserializer
 A deserializer from a binary file. More...
 
class  gf::StaggerHelper
 A helper for computing coordinates in a staggered map. More...
 
class  gf::TextureAtlas
 A collection of sub-texture. More...
 
class  gf::TmxProperties
 The properties for TMX entities. More...
 
class  gf::TmxVisitor
 A visitor for layers in the visitor pattern. More...
 
struct  gf::TmxLayer
 A layer in the whole map. More...
 
struct  gf::TmxCell
 A cell in a tile layer. More...
 
struct  gf::TmxChunk
 A chunk in a tile layer (for infinite maps) More...
 
struct  gf::TmxTileLayer
 A layer with tiles in cells. More...
 
struct  gf::TmxObject
 A geometrical object. More...
 
struct  gf::TmxRectangle
 A rectangle object. More...
 
struct  gf::TmxEllipse
 An ellipse object. More...
 
struct  gf::TmxTileObject
 An image put in the map identified by its global id. More...
 
struct  gf::TmxPolyline
 A polyline object. More...
 
struct  gf::TmxPolygon
 A polygon object. More...
 
struct  gf::TmxText
 A text object. More...
 
struct  gf::TmxPoint
 A point object. More...
 
struct  gf::TmxObjectLayer
 A layer with objects. More...
 
struct  gf::TmxImage
 A reference to an image. More...
 
struct  gf::TmxImageLayer
 A layer with an image. More...
 
struct  gf::TmxGroupLayer
 A layer with other layers. More...
 
struct  gf::TmxFrame
 A frame in a tile animation. More...
 
struct  gf::TmxAnimation
 A tile animation. More...
 
struct  gf::TmxTerrain
 A description of a kind of terrain on the map. More...
 
struct  gf::TmxTile
 A rectangular part of a tileset. More...
 
struct  gf::TmxTileset
 A set of tiles in a single file (image or TSX file) More...
 
struct  gf::TmxLayers
 A TMX map. More...
 
class  gf::Tween< T >
 An interpolation between two values. More...
 

Typedefs

using gf::ConsoleColorControl = char
 A type for color controls in a console. More...
 
using gf::CellFlags = Flags< CellProperty >
 Flags composed of cell properties. More...
 
using gf::MessageHandler = std::function< MessageStatus(Id, Message *)>
 A message handler. More...
 
using gf::MessageHandlerId = uint64_t
 An identifier for a message handler. More...
 

Enumerations

enum  gf::ActivityStatus {
  gf::ActivityStatus::Running,
  gf::ActivityStatus::Finished
}
 Status of an activity. More...
 
enum  gf::ConsoleAlignment {
  gf::ConsoleAlignment::Left,
  gf::ConsoleAlignment::Center,
  gf::ConsoleAlignment::Right
}
 The alignment of the text in the console. More...
 
enum  gf::CellProperty : uint8_t {
  gf::CellProperty::Transparent = 0x01,
  gf::CellProperty::Walkable = 0x02,
  gf::CellProperty::Visible = 0x10,
  gf::CellProperty::Explored = 0x20
}
 A property of a cell. More...
 
enum  gf::FieldOfVision { gf::FieldOfVision::Basic }
 Algorithm for computing a field of vision. More...
 
enum  gf::FieldOfVisionLimit {
  gf::FieldOfVisionLimit::Included,
  gf::FieldOfVisionLimit::Excluded
}
 Constant to indicate if the limit is part of the field of vision. More...
 
enum  gf::Route {
  gf::Route::AStar,
  gf::Route::Dijkstra
}
 Algorithm for computing a route. More...
 
enum  gf::MessageStatus {
  gf::MessageStatus::Keep,
  gf::MessageStatus::Die
}
 A message status. More...
 
enum  gf::StaggerIndex {
  gf::StaggerIndex::Odd,
  gf::StaggerIndex::Even
}
 Stagger index in a staggered or hexagonal map. More...
 
enum  gf::StaggerAxis {
  gf::StaggerAxis::X,
  gf::StaggerAxis::Y
}
 Stagger axis in a staggered or hexagonal map. More...
 
enum  gf::TmxOrientation {
  gf::TmxOrientation::Unknown,
  gf::TmxOrientation::Orthogonal,
  gf::TmxOrientation::Isometric,
  gf::TmxOrientation::Staggered,
  gf::TmxOrientation::Hexagonal
}
 The orientation of the map. More...
 
enum  gf::TmxRenderOrder {
  gf::TmxRenderOrder::RightDown,
  gf::TmxRenderOrder::RightUp,
  gf::TmxRenderOrder::LeftDown,
  gf::TmxRenderOrder::LeftUp
}
 the render order of the tiles. More...
 
enum  gf::TmxDrawOrder {
  gf::TmxDrawOrder::TopDown,
  gf::TmxDrawOrder::Index
}
 The draw order of the objects. More...
 

Variables

constexpr ConsoleColorControl gf::ConsoleColorControl1 = '\x01'
 The constant for color control #1. More...
 
constexpr ConsoleColorControl gf::ConsoleColorControl2 = '\x02'
 The constant for color control #2. More...
 
constexpr ConsoleColorControl gf::ConsoleColorControl3 = '\x03'
 The constant for color control #3. More...
 
constexpr ConsoleColorControl gf::ConsoleColorControl4 = '\x04'
 The constant for color control #4. More...
 
constexpr ConsoleColorControl gf::ConsoleColorControl5 = '\x05'
 The constant for color control #5. More...
 
constexpr ConsoleColorControl gf::ConsoleColorControlStop = '\x06'
 The constant for color control stop. More...
 
constexpr CellFlags gf::EmptyCell = combineFlags(CellProperty::Transparent, CellProperty::Walkable)
 An empty cell. More...
 

Detailed Description

All the classes related to game systems and game entities.

Typedef Documentation

◆ CellFlags

using gf::CellFlags = typedef Flags<CellProperty>

Flags composed of cell properties.

See also
gf::CellProperty

◆ ConsoleColorControl

using gf::ConsoleColorControl = typedef char

A type for color controls in a console.

See also
gf::Console

◆ MessageHandler

using gf::MessageHandler = typedef std::function<MessageStatus(Id, Message *)>

A message handler.

gf::MessageHandler is a function that can be called when a message is sent in a message handler. It can be a free function:

gf::MessageStatus onHeroPosition(gf::Id type, gf::Message *msg) {
assert(type == HeroPosition::type);
auto heroPosition = static_cast<HeroPosition*>(msg);
// do something with heroPosition->position ...
}
// ...
gf::MessageHandler handler = onHeroPosition;

It can also be a member function (which is, in fact, the most probable use case).

struct Foo {
gf::MessageStatus onHeroPosition(gf::Id type, gf::Message *msg) {
assert(type == HeroPosition::type);
auto heroPosition = static_cast<HeroPosition*>(msg);
// do something with heroPosition->position ...
}
};
// ...
Foo foo;
gf::MessageHandler handler = std::bind(&Foo::onHeroPosition, &foo);
See also
gf::MessageManager, gf::Message, gf::Id

◆ MessageHandlerId

using gf::MessageHandlerId = typedef uint64_t

An identifier for a message handler.

See also
gf::MessageHandler

Enumeration Type Documentation

◆ ActivityStatus

enum gf::ActivityStatus
strong

Status of an activity.

See also
gf::Activity
Enumerator
Running 

The activity is still running.

Finished 

The activity is finished.

◆ CellProperty

enum gf::CellProperty : uint8_t
strong

A property of a cell.

See also
gf::CellFlags, gf::SquareMap
Enumerator
Transparent 

The cell is transparent.

Walkable 

The cell is walkable.

Visible 

The cell is visible (computed by FoV)

Explored 

The cell has been explored (computed by FoV)

◆ ConsoleAlignment

enum gf::ConsoleAlignment
strong

The alignment of the text in the console.

See also
gf::Console
Enumerator
Left 

Left alignment.

Center 

Centered alignment.

Right 

Right alignment.

◆ FieldOfVision

enum gf::FieldOfVision
strong

Algorithm for computing a field of vision.

See also
gf::SquareMap
Enumerator
Basic 

A basic algorithm based on ray casting.

◆ FieldOfVisionLimit

Constant to indicate if the limit is part of the field of vision.

The limit is generally a wall that is next to a visible ground cell.

See also
gf::SquareMap
Enumerator
Included 

The limits are included in the field of vision.

Excluded 

The limits are not included in the field of vision.

◆ MessageStatus

enum gf::MessageStatus
strong

A message status.

gf::MessageStatus indicates if a handler should be kept by the message manager or can be removed so that it will not receive any more messages.

See also
gf::MessageManager, gf::MessageHandler
Enumerator
Keep 

The handler must be kept

Die 

The handler can be removed

◆ Route

enum gf::Route
strong

Algorithm for computing a route.

See also
gf::SquareMap
Enumerator
AStar 

The A* algorithm.

Dijkstra 

The Dijkstra algorithm.

◆ StaggerAxis

enum gf::StaggerAxis
strong

Stagger axis in a staggered or hexagonal map.

See also
gf::StaggerIndex, gf::StaggerConverter
Enumerator

The x stagger axis.

The y stagger axis.

◆ StaggerIndex

enum gf::StaggerIndex
strong

Stagger index in a staggered or hexagonal map.

See also
gf::StaggerAxis, gf::StaggerConverter
Enumerator
Odd 

A odd stagger index.

Even 

An even stagger index.

◆ TmxDrawOrder

enum gf::TmxDrawOrder
strong

The draw order of the objects.

Enumerator
TopDown 

Top-down order.

Index 

Index order.

◆ TmxOrientation

enum gf::TmxOrientation
strong

The orientation of the map.

Enumerator
Unknown 

An unknown orientation.

Orthogonal 

An orthogonal orientation.

Isometric 

An isometric orientation.

Staggered 

A staggered orientation.

Hexagonal 

A hexagonal orientation.

◆ TmxRenderOrder

enum gf::TmxRenderOrder
strong

the render order of the tiles.

Enumerator
RightDown 

Right down order.

RightUp 

Right up order.

LeftDown 

Left down order.

LeftUp 

Left up order.

Variable Documentation

◆ ConsoleColorControl1

constexpr ConsoleColorControl gf::ConsoleColorControl1 = '\x01'

The constant for color control #1.

See also
gf::Console

◆ ConsoleColorControl2

constexpr ConsoleColorControl gf::ConsoleColorControl2 = '\x02'

The constant for color control #2.

See also
gf::Console

◆ ConsoleColorControl3

constexpr ConsoleColorControl gf::ConsoleColorControl3 = '\x03'

The constant for color control #3.

See also
gf::Console

◆ ConsoleColorControl4

constexpr ConsoleColorControl gf::ConsoleColorControl4 = '\x04'

The constant for color control #4.

See also
gf::Console

◆ ConsoleColorControl5

constexpr ConsoleColorControl gf::ConsoleColorControl5 = '\x05'

The constant for color control #5.

See also
gf::Console

◆ ConsoleColorControlStop

constexpr ConsoleColorControl gf::ConsoleColorControlStop = '\x06'

The constant for color control stop.

See also
gf::Console

◆ EmptyCell

constexpr CellFlags gf::EmptyCell = combineFlags(CellProperty::Transparent, CellProperty::Walkable)

An empty cell.

An empty cell is transparent and walkable.

See also
gf::CellProperty, gf::SquareMap