Shkyera Engine
Easy to use, game engine for Python
ObjectsWidget.hpp
Go to the documentation of this file.
1
7
#pragma once
8
9
#include <memory>
10
#include <vector>
11
12
#include "
game/Game.hpp
"
13
#include "
ui/Widget.hpp
"
14
15
namespace
shkyera
{
16
22
class
ObjectsWidget
:
public
Widget
{
23
public
:
24
using
Widget::Widget
;
25
31
void
setGame
(std::shared_ptr<Game> game);
32
38
std::shared_ptr<GameObject>
getSelectedObject
()
const
;
39
43
virtual
void
draw
()
override
;
44
45
private
:
49
void
drawCreate
();
50
54
void
drawList
();
55
56
std::shared_ptr<Game>
_game
;
57
std::vector<std::shared_ptr<GameObject>>
_gameObjects
;
58
size_t
_selectedGameObject
;
59
};
60
61
}
// namespace shkyera
Game.hpp
Contains the declaration of the Game class, representing the game environment.
Widget.hpp
Contains the declaration of the Widget class, an abstract base class for GUI widgets.
shkyera::ObjectsWidget
A user interface widget for managing game objects.
Definition:
ObjectsWidget.hpp:22
shkyera::ObjectsWidget::_gameObjects
std::vector< std::shared_ptr< GameObject > > _gameObjects
A list of game objects.
Definition:
ObjectsWidget.hpp:57
shkyera::ObjectsWidget::_game
std::shared_ptr< Game > _game
A shared pointer to the associated game.
Definition:
ObjectsWidget.hpp:56
shkyera::ObjectsWidget::_selectedGameObject
size_t _selectedGameObject
The index of the currently selected game object.
Definition:
ObjectsWidget.hpp:58
shkyera::ObjectsWidget::draw
virtual void draw() override
Implementation of the abstract draw method to render the game objects widget.
Definition:
ObjectsWidget.cpp:15
shkyera::ObjectsWidget::drawList
void drawList()
Draw the list of game objects and allow selection.
Definition:
ObjectsWidget.cpp:39
shkyera::ObjectsWidget::setGame
void setGame(std::shared_ptr< Game > game)
Set the game to associate with this widget.
Definition:
ObjectsWidget.cpp:11
shkyera::ObjectsWidget::drawCreate
void drawCreate()
Draw the creation panel for new game objects.
Definition:
ObjectsWidget.cpp:23
shkyera::ObjectsWidget::getSelectedObject
std::shared_ptr< GameObject > getSelectedObject() const
Get the currently selected game object.
Definition:
ObjectsWidget.cpp:13
shkyera::Widget
An abstract base class representing a GUI widget.
Definition:
Widget.hpp:21
shkyera::Widget::Widget
Widget(std::string name)
Constructor to create a widget with a specified name.
Definition:
Widget.cpp:5
shkyera
Definition:
Entity.cpp:3
src
ui
widgets
ObjectsWidget.hpp
Generated by
1.9.1
Franciszek Szewczyk © 2023