Cytopia
0.3
A city building simulation game
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
Functions
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
w
z
~
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
a
c
d
e
g
i
m
n
p
r
s
t
u
v
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
Functions
b
c
d
f
g
i
m
o
p
r
s
t
w
Variables
a
c
d
g
h
i
l
m
n
r
s
t
Typedefs
a
c
d
e
f
g
i
j
l
m
n
r
s
t
v
Enumerations
Enumerator
a
b
d
e
f
g
l
m
n
p
r
s
t
u
w
z
Macros
_
c
e
i
l
n
r
s
t
v
Examples
▼
Cytopia
Todo List
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
src
►
engine
▼
game
►
ui
GamePlay.cxx
►
GamePlay.hxx
►
PowerGrid.cxx
►
PowerGrid.hxx
PowerManager.cxx
►
PowerManager.hxx
►
ZoneArea.cxx
►
ZoneArea.hxx
ZoneManager.cxx
►
ZoneManager.hxx
►
scripting
►
services
►
util
►
windows
Game.cxx
►
Game.hxx
►
main.cxx
►
MainMenu.cxx
►
MainMenu.hxx
phc.hxx
►
File Members
►
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
PowerGrid.hxx
Go to the documentation of this file.
1
#ifndef POWERGRID_HXX_
2
#define POWERGRID_HXX_
3
4
#include "
Point.hxx
"
5
#include "../engine/GameObjects/MapGrid.hxx"
6
#include <vector>
7
8
struct
PowerNode
9
{
10
Point
coordinate
;
11
int
powerProduction
= 0;
12
};
13
14
class
PowerGrid
;
15
void
mergePowerGrids
(
PowerGrid
&mainGrid,
PowerGrid
&toBeMerged);
16
17
class
PowerGrid
:
public
MapGrid
<PowerNode>
18
{
19
public
:
20
PowerGrid
(
PowerNode
powerNode);
21
27
int
getPowerLevel
()
const
{
return
m_powerLevel
; };
28
33
void
updatePowerLevel
();
34
35
private
:
36
friend
void
mergePowerGrids
(
PowerGrid
&mainGrid,
PowerGrid
&toBeMerged);
37
38
int
m_powerLevel
= 0;
39
};
40
41
#endif
PowerGrid::PowerGrid
PowerGrid(PowerNode powerNode)
Definition:
PowerGrid.cxx:5
PowerGrid
Definition:
PowerGrid.hxx:17
PowerGrid::getPowerLevel
int getPowerLevel() const
Get the Power Level of this grid.
Definition:
PowerGrid.hxx:27
PowerNode::coordinate
Point coordinate
Definition:
PowerGrid.hxx:10
PowerGrid::updatePowerLevel
void updatePowerLevel()
Recalculate the power level of this power grid.
Definition:
PowerGrid.cxx:12
PowerNode
Definition:
PowerGrid.hxx:8
mergePowerGrids
void mergePowerGrids(PowerGrid &mainGrid, PowerGrid &toBeMerged)
Definition:
PowerGrid.cxx:7
Point
Definition:
Point.hxx:7
PowerNode::powerProduction
int powerProduction
Definition:
PowerGrid.hxx:11
PowerGrid::m_powerLevel
int m_powerLevel
Definition:
PowerGrid.hxx:38
PowerGrid::mergePowerGrids
friend void mergePowerGrids(PowerGrid &mainGrid, PowerGrid &toBeMerged)
Definition:
PowerGrid.cxx:7
MapGrid
Definition:
MapGrid.hxx:7
Point.hxx
src
game
PowerGrid.hxx
Generated on Sun Nov 27 2022 09:50:52 for Cytopia by
1.8.17