initial commit, lordsawar source, slightly modified
[lordsawar] / src / history.h
1 //  Copyright (C) 2007, 2008 Ben Asselstine
2 //
3 //  This program is free software; you can redistribute it and/or modify
4 //  it under the terms of the GNU General Public License as published by
5 //  the Free Software Foundation; either version 3 of the License, or
6 //  (at your option) any later version.
7 //
8 //  This program is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 //  GNU Library General Public License for more details.
12 //
13 //  You should have received a copy of the GNU General Public License
14 //  along with this program; if not, write to the Free Software
15 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
16 //  02110-1301, USA.
17
18 #ifndef HISTORY_H
19 #define HISTORY_H
20
21 #include <string>
22 #include "vector.h"
23 #include <sigc++/trackable.h>
24
25 class XML_Helper;
26
27 class Hero;
28 class HeroProto;
29 class City;
30 class Ruin;
31 #include "army.h"
32
33 //! A permanent record of an accomplishment during gameplay.
34 /** 
35  * The purpose of the history classes is to keep track about what a 
36  *  player has accomplished.  This list is retained for the duration of 
37  *  the game.
38  * 
39  * Each history item is derived from the abstract History class. It has to
40  * contain three functions; A loading constructor (which takes an XML_Helper 
41  * parameter), a save function which saves the data, a fillData function 
42  * which takes some parameters and with these stores the data about what 
43  * happened.
44  *
45  */
46 class History
47 {
48     public:
49         //! The xml tag of this object in a saved-game file.
50         static std::string d_tag; 
51
52         //! A History can be one of the following kinds.
53         enum Type {
54           //! The player started a turn.
55           START_TURN = 1,
56           //! The player has searched a Ruin and found a sage.
57           FOUND_SAGE = 2,
58           //! The player has accrued a certain amount of gold in the treasury.
59           GOLD_TOTAL = 3,
60           //! A hero has emerged.
61           HERO_EMERGES = 4,
62           //! A City has been taken.
63           CITY_WON = 5,
64           //! A City has been razed.
65           CITY_RAZED = 6,
66           //! A Hero has inititiated a Quest.
67           HERO_QUEST_STARTED = 7,
68           //! A Hero has completed a Quest.
69           HERO_QUEST_COMPLETED = 8,
70           //! A Hero was killed in battle at a City.
71           HERO_KILLED_IN_CITY = 9,
72           //! A Hero was killed in battle in the field.
73           HERO_KILLED_IN_BATTLE = 10,
74           //! A Hero was killed searching a Ruin.
75           HERO_KILLED_SEARCHING = 11,
76           //! A Hero was involved in taking a City.
77           HERO_CITY_WON = 12,
78           //! The player has this score.
79           SCORE = 13,
80           //! The player has been utterly defeated.
81           PLAYER_VANQUISHED = 14,
82           //! The player has achieved peace with an opponent.
83           DIPLOMATIC_PEACE = 15,
84           //! The player has started a war with an opponent.
85           DIPLOMATIC_WAR = 16,
86           //! The player has been treacherous towards an opponent.
87           DIPLOMATIC_TREACHERY = 17,
88           //! A Hero finds some powerful allies.
89           HERO_FINDS_ALLIES = 18,
90           //! The player has finished a turn.
91           END_TURN = 19,
92           //! The player has explored a ruin.
93           HERO_RUIN_EXPLORED = 20,
94           //! The player has been told of the location of a hidden ruin.
95           HERO_REWARD_RUIN = 21,
96         };
97         static std::string historyTypeToString(const History::Type type);
98         static History::Type historyTypeFromString(const std::string str);
99                 
100         //! Default constructor.
101         History(Type type);
102
103         //! Loading from XML constructor.
104         History (XML_Helper *helper);
105
106         //! Destructor.
107         virtual ~History();
108
109         //! Returns debug information. Needs to be overwritten by derivatives
110         virtual std::string dump() const = 0;
111
112         /** 
113          * static load function (see XML_Helper)
114          * 
115          * Whenever a History item is loaded, this function is called. It
116          * examines the stored History::Type and calls the constructor of 
117          * the appropriate History class.
118          *
119          * @param helper       The opened saved-game file to read from.
120          */
121         //! Load a History from an opened saved-game file.
122         static History* handle_load(XML_Helper* helper);
123
124         //! Copies a history into a new one.
125         static History* copy(const History* a);
126
127         //! Returns the id which identifies the type of History event.
128         Type getType() const {return d_type;}
129         
130         bool save(XML_Helper* helper) const;
131         bool saveContents(XML_Helper* helper) const;
132
133     protected:
134         virtual bool doSave(XML_Helper* helper) const = 0;
135         Type d_type;
136 };
137
138 //-----------------------------------------------------------------------------
139
140 //! A permanent record of a player starting a turn.
141 class History_StartTurn : public History
142 {
143     public:
144         //! Default constructor.
145         History_StartTurn();
146         //! Copy constructor.
147         History_StartTurn(const History_StartTurn &history);
148         //! Load the historical event from an opened saved-game file.
149         History_StartTurn(XML_Helper* helper);
150         //! Destructor.
151         ~History_StartTurn();
152
153         //! Return some debug information about this historical event.
154         std::string dump() const;
155
156         //! Save the historical event to an opened saved-game file.
157         virtual bool doSave(XML_Helper* helper) const;
158
159         //! This method doesn't need to be called for History_StartTurn.
160         bool fillData();
161     
162     private:
163 };
164
165 //-----------------------------------------------------------------------------
166
167 //! A permanent record of a Hero searching a Ruin and finding a sage.
168 class History_FoundSage : public History
169 {
170     public:
171         //! Default constructor.
172         History_FoundSage();
173         //! Copy constructor.
174         History_FoundSage(const History_FoundSage &history);
175         //! Load the historical event from an opened saved-game file.
176         History_FoundSage(XML_Helper* helper);
177         //! Destructor.
178         ~History_FoundSage();
179
180         //! Return some debug information about this historical event.
181         std::string dump() const;
182
183         //! Save the historical event to an opened saved-game file.
184         virtual bool doSave(XML_Helper* helper) const;
185
186         //! Populate the event with the Hero who found the sage.
187         bool fillData(Hero *hero);
188
189         //! Get the name of the Hero who found the sage.
190         std::string getHeroName() const {return d_hero;}
191     
192     private:
193         //! The name of the Hero.
194         std::string d_hero;
195 };
196
197 //-----------------------------------------------------------------------------
198
199 //! A permanent record of the amount of gold pieces a player has.
200 class History_GoldTotal : public History
201 {
202     public:
203         //! Default constructor.
204         History_GoldTotal();
205         //! Copy constructor.
206         History_GoldTotal(const History_GoldTotal &history);
207         //! Load the historical event from an opened saved-game file.
208         History_GoldTotal(XML_Helper* helper);
209         //! Destructor.
210         ~History_GoldTotal();
211
212         //! Return some debug information about this historical event.
213         std::string dump() const;
214
215         //! Save the historical event to an opened saved-game file.
216         virtual bool doSave(XML_Helper* helper) const;
217
218         //! Populate the event with the amount of gold pieces the Player has.
219         bool fillData(int gold);
220
221         //! Get the amount of gold associated with this event.
222         int getGold() const {return d_gold;}
223     
224     private:
225         //! The amount of gold pieces the player has at a point in time.
226         int d_gold;
227 };
228
229 //-----------------------------------------------------------------------------
230
231 //! A permanent record of a new Hero emerging in a City.
232 class History_HeroEmerges : public History
233 {
234     public:
235         //! Default constructor.
236         History_HeroEmerges();
237         //! Copy constructor.
238         History_HeroEmerges(const History_HeroEmerges &history);
239         //! Load the historical event from an opened saved-game file.
240         History_HeroEmerges(XML_Helper* helper);
241         //! Destructor.
242         ~History_HeroEmerges();
243
244         //! Return some debug information about this historical event.
245         std::string dump() const;
246
247         //! Save the historical event to an opened saved-game file.
248         virtual bool doSave(XML_Helper* helper) const;
249
250         //! Populate the event with pertinent data.
251         /**
252          * Populate the event with the new Hero who has showed up and 
253          * the City where it has appeared.
254          *
255          * @param hero    The Hero that has emergerd.
256          * @param city    The City where the Hero has emerged.
257          */
258         bool fillData(Hero *hero, City *city);
259
260         //! Get the name of the Hero who appeared.
261         std::string getHeroName() const {return d_hero;}
262
263         guint32 getHeroId() const {return d_hero_id;};
264
265         //! Get the name of the City where the Hero has emerged.
266         std::string getCityName() const {return d_city;}
267     
268     private:
269         //! The name of the Hero who emerged.
270         std::string d_hero;
271
272         //! The id of the hero
273         guint32 d_hero_id;
274
275         //! The name of the City where the Hero emerged.
276         std::string d_city;
277 };
278
279 //-----------------------------------------------------------------------------
280
281 //! A permanent record of an enemy city being defeated.
282 class History_CityWon : public History
283 {
284     public:
285         //! Default constructor.
286         History_CityWon();
287         //! Copy constructor.
288         History_CityWon(const History_CityWon &history);
289         //! Load the historical event from an opened saved-game file.
290         History_CityWon(XML_Helper* helper);
291         //! Destructor.
292         ~History_CityWon();
293
294         //! Return some debug information about this historical event.
295         std::string dump() const;
296
297         //! Save the historical event to an opened saved-game file.
298         virtual bool doSave(XML_Helper* helper) const;
299
300         //! Populate the record with the City that the Player defeated.
301         bool fillData(City *city);
302
303         //! Get the Id of the City object that was defeated.
304         guint32 getCityId() const {return d_city;}
305     
306     private:
307         //! The Id of the City object that was defeated.
308         guint32 d_city;
309 };
310
311 //-----------------------------------------------------------------------------
312
313 //! A permanent record of an enemy city being defeated by a Hero.
314 class History_HeroCityWon: public History
315 {
316     public:
317         //! Default constructor.
318         History_HeroCityWon();
319         //! Copy constructor.
320         History_HeroCityWon(const History_HeroCityWon &history);
321         //! Load the historical event from an opened saved-game file.
322         History_HeroCityWon(XML_Helper* helper);
323         //! Destructor.
324         ~History_HeroCityWon();
325
326         //! Return some debug information about this historical event.
327         std::string dump() const;
328
329         //! Save the historical event to an opened saved-game file.
330         virtual bool doSave(XML_Helper* helper) const;
331
332         //! Populate the event with pertinent data.
333         /**
334          * Populate the event with the City that was defeated and the
335          * Hero that assisted in the conquering.
336          *
337          * @param city    The City that was conquered.
338          * @param hero    The Hero who lead the conquering of the City.
339          */
340         bool fillData(Hero *hero, City *city);
341
342         //! Get the name of the Hero who conquered the City.
343         std::string getHeroName() const {return d_hero;}
344
345         //! Get the name of the City that was conquered.
346         std::string getCityName() const {return d_city;}
347     
348     private:
349         //! The name of the Hero who helped in conquering the City.
350         std::string d_hero;
351
352         //! The name of the City that was conquered.
353         std::string d_city;
354 };
355
356 //-----------------------------------------------------------------------------
357
358 //! A permanent record of an enemy city being razed.
359 class History_CityRazed : public History
360 {
361     public:
362         //! Default constructor.
363         History_CityRazed();
364         //! Copy constructor.
365         History_CityRazed(const History_CityRazed &history);
366         //! Load the historical event from an opened saved-game file.
367         History_CityRazed(XML_Helper* helper);
368         //! Destructor.
369         ~History_CityRazed();
370
371         //! Return some debug information about this historical event.
372         std::string dump() const;
373
374         //! Save the historical event to an opened saved-game file.
375         virtual bool doSave(XML_Helper* helper) const;
376
377         //! Populate the event with the City that was razed.
378         bool fillData(City *city);
379
380         //! Get the Id of the City object that was razed.
381         guint32 getCityId() const {return d_city;}
382     
383     private:
384         //! The Id of the City that was razed.
385         guint32 d_city;
386 };
387
388 //-----------------------------------------------------------------------------
389
390 //! A permanent record of a Hero initiating a Quest.
391 class History_HeroQuestStarted : public History
392 {
393     public:
394         //! Default constructor.
395         History_HeroQuestStarted();
396         //! Copy constructor.
397         History_HeroQuestStarted(const History_HeroQuestStarted &history);
398         //! Load the historical event from an opened saved-game file.
399         History_HeroQuestStarted(XML_Helper* helper);
400         //! Destructor.
401         ~History_HeroQuestStarted();
402
403         //! Return some debug information about this historical event.
404         std::string dump() const;
405
406         //! Save the historical event to an opened saved-game file.
407         virtual bool doSave(XML_Helper* helper) const;
408
409         //! Populate the event with the Hero who initiated a new Quest.
410         bool fillData(Hero *hero);
411
412         //! Get the name of the Hero who started a Quest.
413         std::string getHeroName() const {return d_hero;}
414     
415     private:
416         //! The name of the Hero who started the Quest.
417         std::string d_hero;
418 };
419
420 //-----------------------------------------------------------------------------
421
422 //! A permanent record of a Hero completing a Quest.
423 class History_HeroQuestCompleted: public History
424 {
425     public:
426         //! Default constructor.
427         History_HeroQuestCompleted();
428         //! Copy constructor.
429         History_HeroQuestCompleted(const History_HeroQuestCompleted &history);
430         //! Load the historical event from an opened saved-game file.
431         History_HeroQuestCompleted(XML_Helper* helper);
432         //! Destructor.
433         ~History_HeroQuestCompleted();
434
435         //! Return some debug information about this historical event.
436         std::string dump() const;
437
438         //! Save the historical event to an opened saved-game file.
439         virtual bool doSave(XML_Helper* helper) const;
440
441         //! Populate the event with the Hero who finished a Quest.
442         bool fillData(Hero *hero);
443
444         //! Get the name of the Hero who finished a Quest.
445         std::string getHeroName() const {return d_hero;}
446     
447     private:
448         //! The name of the Hero who completed the Quest.
449         std::string d_hero;
450 };
451
452 //-----------------------------------------------------------------------------
453
454 //! A permanent record of a Hero killed in the defense or attack of a City.
455 class History_HeroKilledInCity : public History
456 {
457     public:
458         //! Default constructor.
459         History_HeroKilledInCity();
460         //! Copy constructor.
461         History_HeroKilledInCity(const History_HeroKilledInCity &history);
462         //! Load the historical event from an opened saved-game file.
463         History_HeroKilledInCity(XML_Helper* helper);
464         //! Destructor.
465         ~History_HeroKilledInCity();
466
467         //! Return some debug information about this historical event.
468         std::string dump() const;
469
470         //! Save the historical event to an opened saved-game file.
471         virtual bool doSave(XML_Helper* helper) const;
472
473         //! Populate the event with pertinent data.
474         /**
475          * Populate the event with the Hero who was killed and the City where
476          * it happened.
477          *
478          * @param hero    The Hero who died.
479          * @param city    The City that houses the Hero's broken corpse.
480          */
481         bool fillData(Hero *hero, City *city);
482
483         //! Get the name of the Hero who died.
484         std::string getHeroName() const {return d_hero;}
485
486         //! Get the name of the City where the Hero died.
487         std::string getCityName() const {return d_city;}
488     
489     private:
490         //! Get the name of the Hero who was killed.
491         std::string d_hero;
492
493         //! Get the name of the City where the Hero was killed.
494         std::string d_city;
495 };
496
497 //-----------------------------------------------------------------------------
498
499 //! A permanent record of a Hero killed in battle outside of a City.
500 class History_HeroKilledInBattle: public History
501 {
502     public:
503         //! Default constructor.
504         History_HeroKilledInBattle();
505         //! Copy constructor.
506         History_HeroKilledInBattle(const History_HeroKilledInBattle &history);
507         //! Load the historical event from an opened saved-game file.
508         History_HeroKilledInBattle(XML_Helper* helper);
509         //! Destructor.
510         ~History_HeroKilledInBattle();
511
512         //! Return some debug information about this historical event.
513         std::string dump() const;
514
515         //! Save the historical event to an opened saved-game file.
516         virtual bool doSave(XML_Helper* helper) const;
517
518         //! Populate the event with the Hero who was killed in battle.
519         bool fillData(Hero *hero);
520
521         //! Get the name of the Hero who died in battle outside of a City.
522         std::string getHeroName() const {return d_hero;}
523     
524     private:
525         //! The name of the Hero who died in battle outside of a City.
526         std::string d_hero;
527 };
528
529 //-----------------------------------------------------------------------------
530
531 //! A permanent record of a Hero killed while searching a Ruin.
532 class History_HeroKilledSearching: public History
533 {
534     public:
535         //! Default constructor.
536         History_HeroKilledSearching();
537         //! Copy constructor.
538         History_HeroKilledSearching(const History_HeroKilledSearching &history);
539         //! Load the historical event from an opened saved-game file.
540         History_HeroKilledSearching(XML_Helper* helper);
541         //! Destructor.
542         ~History_HeroKilledSearching();
543
544         //! Return some debug information about this historical event.
545         std::string dump() const;
546
547         //! Save the historical event to an opened saved-game file.
548         virtual bool doSave(XML_Helper* helper) const;
549
550         //! Populate the event with the Hero who was killed while searching.
551         bool fillData(Hero *hero);
552
553         //! Get the name of the Hero who died while searching a Ruin.
554         std::string getHeroName() const {return d_hero;}
555     
556     private:
557         //! The name of the Hero who died while searching a Ruin.
558         std::string d_hero;
559 };
560
561 //-----------------------------------------------------------------------------
562
563 //! A permanent record of the player's score.
564 class History_Score: public History
565 {
566     public:
567         //! Default constructor.
568         History_Score();
569         //! Copy constructor.
570         History_Score(const History_Score &history);
571         //! Load the historical event from an opened saved-game file.
572         History_Score(XML_Helper* helper);
573         //! Destructor.
574         ~History_Score();
575
576         //! Return some debug information about this historical event.
577         std::string dump() const;
578
579         //! Save the historical event to an opened saved-game file.
580         virtual bool doSave(XML_Helper* helper) const;
581
582         //! Populate the event with the player's score for this turn.
583         bool fillData(guint32 score);
584
585         //! Get the player's score for this turn.
586         guint32 getScore() const {return d_score;}
587     
588     private:
589         //! The player's score.
590         int d_score;
591 };
592
593 //-----------------------------------------------------------------------------
594
595 //! A permanent record of the player being utterly defeated.
596 class History_PlayerVanquished: public History
597 {
598     public:
599         //! Default constructor.
600         History_PlayerVanquished();
601         //! Copy constructor.
602         History_PlayerVanquished(const History_PlayerVanquished &history);
603         //! Load the historical event from an opened saved-game file.
604         History_PlayerVanquished(XML_Helper* helper);
605         //! Destructor.
606         ~History_PlayerVanquished();
607
608         //! Return some debug information about this historical event.
609         std::string dump() const;
610
611         //! Save the historical event to an opened saved-game file.
612         virtual bool doSave(XML_Helper* helper) const;
613
614 };
615
616 //-----------------------------------------------------------------------------
617
618 //! A permanent record of the player making peace with an opponent.
619 class History_DiplomacyPeace : public History
620 {
621     public:
622         //! Default constructor.
623         History_DiplomacyPeace();
624         //! Copy constructor.
625         History_DiplomacyPeace(const History_DiplomacyPeace &history);
626         //! Load the historical event from an opened saved-game file.
627         History_DiplomacyPeace(XML_Helper* helper);
628         //! Destructor.
629         ~History_DiplomacyPeace();
630
631         //! Return some debug information about this historical event.
632         std::string dump() const;
633
634         //! Save the historical event to an opened saved-game file.
635         virtual bool doSave(XML_Helper* helper) const;
636
637         //! Populate the event with the Player who we are at peace with.
638         bool fillData(Player *opponent);
639
640         //! Get the Id of the Player object we are at peace with.
641         guint32 getOpponentId() const {return d_opponent_id;}
642     
643     private:
644         //! The Id of the Player object we are at peace with.
645         guint32 d_opponent_id;
646 };
647
648 //-----------------------------------------------------------------------------
649
650 //! A permanent record of the player going to war with an opponent.
651 class History_DiplomacyWar: public History
652 {
653     public:
654         //! Default constructor.
655         History_DiplomacyWar();
656         //! Copy constructor.
657         History_DiplomacyWar(const History_DiplomacyWar &history);
658         //! Load the historical event from an opened saved-game file.
659         History_DiplomacyWar(XML_Helper* helper);
660         //! Destructor.
661         ~History_DiplomacyWar();
662
663         //! Return some debug information about this historical event.
664         std::string dump() const;
665
666         //! Save the historical event to an opened saved-game file.
667         virtual bool doSave(XML_Helper* helper) const;
668
669         //! Populate the event with the Player who we are at war with.
670         bool fillData(Player *opponent);
671
672         //! Get the Id of the Player object we are at war with.
673         guint32 getOpponentId() const {return d_opponent_id;}
674     
675     private:
676         // The Id of the Player object we are at war with.
677         guint32 d_opponent_id;
678 };
679
680 //-----------------------------------------------------------------------------
681
682 //! A permanent record of the player being treacherous to an opponent.
683 class History_DiplomacyTreachery: public History
684 {
685     public:
686         //! Default constructor.
687         History_DiplomacyTreachery();
688         //! Copy constructor.
689         History_DiplomacyTreachery(const History_DiplomacyTreachery &history);
690         //! Load the historical event from an opened saved-game file.
691         History_DiplomacyTreachery(XML_Helper* helper);
692         //! Destructor.
693         ~History_DiplomacyTreachery();
694
695         //! Return some debug information about this historical event.
696         std::string dump() const;
697
698         //! Save the historical event to an opened saved-game file.
699         virtual bool doSave(XML_Helper* helper) const;
700
701         //! Populate the event with the Player we performed treachery on.
702         bool fillData(Player *opponent);
703
704         //! Get the Id of the Player object that we peformed treachery on.
705         guint32 getOpponentId() const {return d_opponent_id;}
706     
707     private:
708         //! The Id of the Player object that we peformed treachery on.
709         guint32 d_opponent_id;
710 };
711
712 //-----------------------------------------------------------------------------
713
714 //! A permanent record of a Hero finding powerful allies.
715 class History_HeroFindsAllies : public History
716 {
717     public:
718         //! Default constructor.
719         History_HeroFindsAllies();
720         //! Copy constructor.
721         History_HeroFindsAllies(const History_HeroFindsAllies &history);
722         //! Load the historical event from an opened saved-game file.
723         History_HeroFindsAllies(XML_Helper* helper);
724         //! Destructor.
725         ~History_HeroFindsAllies();
726
727         //! Return some debug information about this historical event.
728         std::string dump() const;
729
730         //! Save the historical event to an opened saved-game file.
731         virtual bool doSave(XML_Helper* helper) const;
732
733         //! Populate the event with the name of the Hero who found allies.
734         bool fillData(Hero *hero);
735
736         //! Get the name of the Hero who found powerful allies.
737         std::string getHeroName() const {return d_hero;}
738     
739     private:
740         //! The name of the Hero who found powerful allies at a Ruin.
741         std::string d_hero;
742 };
743
744 //-----------------------------------------------------------------------------
745 //! A permanent record of a player ending a turn.
746 class History_EndTurn : public History
747 {
748     public:
749         //! Default constructor.
750         History_EndTurn();
751         //! Copy constructor.
752         History_EndTurn(const History_EndTurn &history);
753         //! Load the historical event from an opened saved-game file.
754         History_EndTurn(XML_Helper* helper);
755         //! Destructor.
756         ~History_EndTurn();
757
758         //! Return some debug information about this historical event.
759         std::string dump() const;
760
761         //! Save the historical event to an opened saved-game file.
762         virtual bool doSave(XML_Helper* helper) const;
763
764         //! This method doesn't need to be called for History_EndTurn.
765         bool fillData();
766     
767     private:
768 };
769 //-----------------------------------------------------------------------------
770
771 //! A permanent record of a ruin being successfully searched by a Hero.
772 class History_HeroRuinExplored: public History
773 {
774     public:
775         //! Default constructor.
776         History_HeroRuinExplored();
777         //! Copy constructor.
778         History_HeroRuinExplored(const History_HeroRuinExplored &history);
779         //! Load the historical event from an opened saved-game file.
780         History_HeroRuinExplored(XML_Helper* helper);
781         //! Destructor.
782         ~History_HeroRuinExplored();
783
784         //! Return some debug information about this historical event.
785         std::string dump() const;
786
787         //! Save the historical event to an opened saved-game file.
788         virtual bool doSave(XML_Helper* helper) const;
789
790         //! Populate the event with pertinent data.
791         /**
792          * Populate the event with the Ruin that was searched and
793          * the Hero that did the exploration.
794          *
795          * @param ruin    The Ruin that was explored.
796          * @param hero    The Hero who did the exploration of the Ruin.
797          */
798         bool fillData(Hero *hero, Ruin *ruin);
799
800         //! Get the name of the Hero who searched the Ruin.
801         std::string getHeroName() const {return d_hero;}
802
803         //! Get the id of the Ruin that was searched.
804         guint32 getRuinId() const {return d_ruin;}
805     
806     private:
807         //! The name of the Hero who explored the Ruin.
808         std::string d_hero;
809
810         //! The id of the Ruin that was searched.
811         guint32 d_ruin;
812 };
813
814
815 //-----------------------------------------------------------------------------
816
817 //! A permanent record of the location of a ruin being given to a Hero.
818 class History_HeroRewardRuin: public History
819 {
820     public:
821         //! Default constructor.
822         History_HeroRewardRuin();
823         //! Copy constructor.
824         History_HeroRewardRuin(const History_HeroRewardRuin&history);
825         //! Load the historical event from an opened saved-game file.
826         History_HeroRewardRuin(XML_Helper* helper);
827         //! Destructor.
828         ~History_HeroRewardRuin();
829
830         //! Return some debug information about this historical event.
831         std::string dump() const;
832
833         //! Save the historical event to an opened saved-game file.
834         virtual bool doSave(XML_Helper* helper) const;
835
836         //! Populate the event with pertinent data.
837         /**
838          * Populate the event with the Ruin that was exposed and
839          * the Hero that received the location of the ruin.
840          *
841          * @param ruin    The Ruin that was exposed.
842          * @param hero    The Hero who received the location of the Ruin.
843          */
844         bool fillData(Hero *hero, Ruin *ruin);
845
846         //! Get the name of the Hero who was given the location of the Ruin.
847         std::string getHeroName() const {return d_hero;}
848
849         //! Get the id of the Ruin that was exposed.
850         guint32 getRuinId() const {return d_ruin;}
851     
852     private:
853         //! The name of the Hero who was told the location of the Ruin.
854         std::string d_hero;
855
856         //! The id of the Ruin that was exposed.
857         guint32 d_ruin;
858 };
859
860 #endif //HISTORY_H