Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef TIME_OF_DAY_HPP_INCLUDED
00019 #define TIME_OF_DAY_HPP_INCLUDED
00020
00021 #include "global.hpp"
00022
00023 #include "tstring.hpp"
00024
00025 #include <vector>
00026
00027 class config;
00028
00029
00030
00031 struct tod_color{
00032 tod_color(int red = 0, int green = 0, int blue = 0) : r(red), g(green), b(blue) {}
00033 bool operator==(const tod_color& o) const { return r == o.r && g == o.g && b == o.b; }
00034 bool is_zero() const { return r == 0 && g == 0 && b == 0; }
00035 bool operator!=(const tod_color& o) const { return !operator==(o); }
00036 tod_color operator+(const tod_color& o) const { return tod_color(r+o.r, g+o.g, b+o.b);}
00037 void operator*=(float x) { r *= x; g *= x; b *= x;}
00038
00039 int r,g,b;
00040 };
00041
00042 std::ostream &operator<<(std::ostream &s, const tod_color& tod);
00043
00044
00045
00046
00047
00048
00049 struct time_of_day
00050 {
00051
00052
00053
00054
00055
00056
00057 explicit time_of_day();
00058
00059
00060 explicit time_of_day(const config& cfg);
00061
00062 void write(config& cfg) const;
00063
00064
00065 int lawful_bonus;
00066 int bonus_modified;
00067
00068
00069 std::string image;
00070 t_string name;
00071 std::string id;
00072
00073
00074
00075
00076
00077 std::string image_mask;
00078
00079
00080
00081
00082
00083 tod_color color;
00084
00085
00086
00087
00088
00089 std::string sounds;
00090
00091
00092
00093
00094 static void parse_times(const config& cfg, std::vector<time_of_day>& normal_times);
00095 };
00096
00097 #endif