diff options
Diffstat (limited to 'include/world.h')
-rw-r--r-- | include/world.h | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/include/world.h b/include/world.h index 5b02c87..dd06469 100644 --- a/include/world.h +++ b/include/world.h @@ -47,16 +47,6 @@ enum class WorldWeather : unsigned char { }; /** - * The light structure, used to store light coordinates and color. - */ - -typedef struct { - vec2 loc; /**< Light location */ - Color color; /**< Light color */ - float radius; -} Light; - -/** * The line structure. * This structure is used to store the world's ground, stored in vertical * lines. Dirt color and grass properties are also kept track of here. @@ -86,6 +76,45 @@ extern std::string currentXML; class World; /** + * The light structure, used to store light coordinates and color. + */ + +class Light{ +public: + vec2 loc; /**< Light location */ + Color color; /**< Light color */ + float radius; /**< Light radius */ + + bool belongsTo; + Entity *following; + + bool flame; + float fireFlicker; + vec2 fireLoc; + + Light(vec2 l, Color c, float r){ + loc = l; + color = c; + radius = r; + + belongsTo = false; + following = nullptr; + + flame = false; + } + + void makeFlame(void){ + flame = true; + } + + void follow(Entity *f){ + following=f; + belongsTo = true; + } +}; + + +/** * The village class, used to group structures into villages. */ |