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
//------------------------------------------------------------------------------
22
class
PackedLevel
23
{
24
public
:
26
Util::Array<Game::Entity>
Instantiate
()
const
;
27
28
private
:
29
friend
class
World
;
30
31
PackedLevel
() {};
// only worlds may create this
32
33
// only worlds may destroy this
34
~PackedLevel
()
35
{
36
for
(
auto
& t :
tables
)
37
{
38
if
(t.columns !=
nullptr
)
39
delete
[] t.columns;
40
}
41
};
42
43
// the destination world if we are to instantiate this level
44
Game::World
*
world
;
45
46
struct
EntityGroup
47
{
48
MemDb::TableId
dstTable
;
49
SizeT
numRows
;
50
ubyte
*
columns
=
nullptr
;
51
};
52
53
Util::Array<EntityGroup>
tables
;
54
};
55
56
}
// namespace Game
entity.h
Game::PackedLevel
Definition
level.h:23
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:31
Game::PackedLevel::~PackedLevel
~PackedLevel()
Definition
level.h:34
Game::PackedLevel::tables
Util::Array< EntityGroup > tables
Definition
level.h:53
Game::PackedLevel::world
Game::World * world
Definition
level.h:44
Game::World
Definition
world.h:50
Util::Array
Nebula's dynamic array class.
Definition
array.h:60
database.h
Game
Game::EditorState.
Definition
orientation.h:7
refcounted.h
Game::PackedLevel::EntityGroup
Definition
level.h:47
Game::PackedLevel::EntityGroup::numRows
SizeT numRows
Definition
level.h:49
Game::PackedLevel::EntityGroup::dstTable
MemDb::TableId dstTable
Definition
level.h:48
Game::PackedLevel::EntityGroup::columns
ubyte * columns
Definition
level.h:50
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 Wed Nov 13 2024 21:37:26 for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.