1 /*************************************************************************** 2 * Copyright (C) 2009 by Andrey Afletdinov <fheroes2@gmail.com> * 3 * * 4 * Part of the Free Heroes2 Engine: * 5 * http://sourceforge.net/projects/fheroes2 * 6 * * 7 * This program is free software; you can redistribute it and/or modify * 8 * it under the terms of the GNU General Public License as published by * 9 * the Free Software Foundation; either version 2 of the License, or * 10 * (at your option) any later version. * 11 * * 12 * This program is distributed in the hope that it will be useful, * 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 * GNU General Public License for more details. * 16 * * 17 * You should have received a copy of the GNU General Public License * 18 * along with this program; if not, write to the * 19 * Free Software Foundation, Inc., * 20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 21 ***************************************************************************/ 22 23 #ifndef H2WEEK_H 24 #define H2WEEK_H 25 26 #include "monster.h" 27 28 enum class WeekName : int 29 { 30 UNNAMED, 31 PLAGUE, 32 ANT, 33 GRASSHOPPER, 34 DRAGONFLY, 35 SPIDER, 36 BUTTERFLY, 37 BUMBLEBEE, 38 LOCUST, 39 EARTHWORM, 40 HORNET, 41 BEETLE, 42 SQUIRREL, 43 RABBIT, 44 GOPHER, 45 BADGER, 46 EAGLE, 47 WEASEL, 48 RAVEN, 49 MONGOOSE, 50 AARDVARK, 51 LIZARD, 52 TORTOISE, 53 HEDGEHOG, 54 CONDOR, 55 MONSTERS // week of "monster" 56 }; 57 58 class World; 59 60 struct Week 61 { 62 Week( const WeekName type = WeekName::UNNAMED, const Monster::monster_t monster = Monster::UNKNOWN ) _weekWeek63 : _week( type ) 64 , _monster( monster ) 65 {} 66 GetTypeWeek67 WeekName GetType() const 68 { 69 return _week; 70 } 71 GetMonsterWeek72 Monster::monster_t GetMonster() const 73 { 74 return _monster; 75 } 76 77 const char * GetName() const; 78 79 static Week RandomWeek( const World & world, const bool isNewMonth, const size_t weekSeed ); 80 81 friend StreamBase & operator>>( StreamBase & stream, Week & week ); 82 83 private: 84 WeekName _week; 85 Monster::monster_t _monster; 86 }; 87 88 StreamBase & operator>>( StreamBase & stream, Week & week ); 89 StreamBase & operator<<( StreamBase & stream, const Week & week ); 90 91 #endif 92