Nebula
Loading...
Searching...
No Matches
level.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
9
//------------------------------------------------------------------------------
10
#include "
core/refcounted.h
"
11
#include "
memdb/database.h
"
12
#include "
game/entity.h
"
13
14
namespace
Game
15
{
16
17
class
World
;
18
19
//------------------------------------------------------------------------------
37
class
PackedLevel
38
{
39
public
:
41
Util::Array<Game::Entity>
Instantiate
()
const
;
42
43
private
:
44
friend
class
World
;
45
46
PackedLevel
() {};
// only worlds may create this
47
48
// only worlds may destroy this
49
~PackedLevel
()
50
{
51
for
(
auto
& t :
tables
)
52
{
53
if
(t.columns !=
nullptr
)
54
delete
[] t.columns;
55
}
56
};
57
58
// the destination world if we are to instantiate this level
59
Game::World
*
world
;
60
61
struct
EntityGroup
62
{
63
MemDb::TableId
dstTable
;
64
SizeT
numRows
;
65
ubyte
*
columns
=
nullptr
;
66
};
67
68
Util::Array<EntityGroup>
tables
;
69
};
70
71
}
// namespace Game
entity.h
Game::PackedLevel::Instantiate
Util::Array< Game::Entity > Instantiate() const
instantiates the level into game world
Definition
level.cc:19
Game::PackedLevel::PackedLevel
PackedLevel()
Definition
level.h:46
Game::PackedLevel::~PackedLevel
~PackedLevel()
Definition
level.h:49
Game::PackedLevel::World
friend class World
Definition
level.h:44
Game::PackedLevel::tables
Util::Array< EntityGroup > tables
Definition
level.h:68
Game::PackedLevel::world
Game::World * world
Definition
level.h:59
Game::World
A container of entities, their components, and processors.
Definition
world.h:81
Util::Array
Nebula's dynamic array class.
Definition
array.h:60
database.h
Game
Game::EditorState.
Definition
graphicsmanager.h:64
refcounted.h
Game::PackedLevel::EntityGroup
Definition
level.h:62
Game::PackedLevel::EntityGroup::numRows
SizeT numRows
Definition
level.h:64
Game::PackedLevel::EntityGroup::dstTable
MemDb::TableId dstTable
Definition
level.h:63
Game::PackedLevel::EntityGroup::columns
ubyte * columns
Definition
level.h:65
MemDb::TableId
Table identifier.
Definition
tableid.h:14
ubyte
unsigned char ubyte
Definition
types.h:34
SizeT
int SizeT
Definition
types.h:49
code
application
basegamefeature
level.h
Generated on Tue Jan 28 2025 22:42:57 for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.