~ubuntu-branches/ubuntu/raring/lordsawar/raring

« back to all changes in this revision

Viewing changes to src/gui/history-report-dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese, Gonéri Le Bouder
  • Date: 2008-06-17 11:15:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080617111526-yjyvu9df50zmpdo0
Tags: 0.0.9-1
[ Barry deFreese ]
* New upstream release.
  + Fixes gcc-4.3 builds so drop ftbfs_gcc-4.3_fix.diff.
  + Add new build-dependency for libgnet-dev.
* Add simple man page for new lordsawar-tile-editor.
* Add desktop file for lordsawar-tile-editor.
* Remove French translation on install.

[ Gonéri Le Bouder ]
* bump Debian Policy to 3.8.0. No change needed.
* fix wording in the 0.0.8-3 entry of the Debian changelog

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2007, 2008 Ben Asselstine
 
2
//
1
3
//  This program is free software; you can redistribute it and/or modify
2
4
//  it under the terms of the GNU General Public License as published by
3
5
//  the Free Software Foundation; either version 2 of the License, or
10
12
//
11
13
//  You should have received a copy of the GNU General Public License
12
14
//  along with this program; if not, write to the Free Software
13
 
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.*
 
15
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
 
16
//  02110-1301, USA.
14
17
 
15
18
#include <config.h>
16
19
 
105
108
 
106
109
  generatePastCityCounts();
107
110
  city_chart = new LineChart(past_citycounts, d_colours, 
108
 
                             Citylist::getInstance()->size());
 
111
                             Citylist::getInstance()->size(),
 
112
                             _("Cities"), _("Turns"));
109
113
  city_alignment->add(*manage(city_chart));
110
114
 
111
115
  generatePastGoldCounts();
112
 
  gold_chart = new LineChart(past_goldcounts, d_colours, 0);
 
116
  gold_chart = new LineChart(past_goldcounts, d_colours, 0, 
 
117
                             _("Gold Pieces"), _("Turns"));
113
118
  gold_alignment->add(*manage(gold_chart));
114
119
 
115
120
  generatePastWinningCounts();
116
 
  rank_chart = new LineChart(past_rankcounts, d_colours, 100);
 
121
  rank_chart = new LineChart(past_rankcounts, d_colours, 100,
 
122
                             _("Score"), _("Turns"));
117
123
  winner_alignment->add(*manage(rank_chart));
118
124
 
119
125
  fill_in_turn_info((Uint32)turn_scale->get_value());
177
183
                case History::DIPLOMATIC_TREACHERY:
178
184
                case History::DIPLOMATIC_WAR:
179
185
                case History::DIPLOMATIC_PEACE:
180
 
                  (*hit[id])->setPlayer(*pit);
 
186
                  (*hit[id])->setOwner(*pit);
181
187
                  elist->push_back(*hit[id]);
182
188
                  break;
183
189
                case History::START_TURN:
228
234
    }
229
235
 
230
236
  //start off with an initial city list where all cities are neutral owned
231
 
  ObjectList<City> *clist = new ObjectList<City>();
 
237
  LocationList<City> *clist = new LocationList<City>();
232
238
  Citylist *cl = Citylist::getInstance();
233
239
  for (Citylist::iterator it = cl->begin(); it != cl->end(); ++it)
234
240
    clist->push_back(*it);
235
 
  for (ObjectList<City>::iterator it = clist->begin(); it != clist->end(); ++it)
 
241
  for (LocationList<City>::iterator it = clist->begin(); it != clist->end(); ++it)
236
242
    {
237
 
      (*it).setPlayer(Playerlist::getInstance()->getNeutral());
 
243
      (*it).setOwner(Playerlist::getInstance()->getNeutral());
238
244
      (*it).setBurnt(false);
239
245
    }
240
246
 
263
269
                  Uint32 city_id;
264
270
                  city_id = dynamic_cast<History_CityWon*>(*hit[id])->getCityId();
265
271
                  //find city with this city id in clist
266
 
                  ObjectList<City>::iterator cit = clist->begin();
 
272
                  LocationList<City>::iterator cit = clist->begin();
267
273
                  for (; cit != clist->end(); ++cit)
268
274
                    if ((*cit).getId() == city_id)
269
275
                      {
270
 
                        (*cit).setPlayer(*pit);
 
276
                        (*cit).setOwner(*pit);
271
277
                        break;
272
278
                      }
273
279
                }
276
282
                  Uint32 city_id;
277
283
                  city_id = dynamic_cast<History_CityRazed*>(*hit[id])->getCityId();
278
284
                  //find city with this city id in clist
279
 
                  ObjectList<City>::iterator cit = clist->begin();
 
285
                  LocationList<City>::iterator cit = clist->begin();
280
286
                  for (; cit != clist->end(); ++cit)
281
287
                    if ((*cit).getId() == city_id)
282
288
                      {
283
289
                        //change the owner to neutral 
284
 
                        (*cit).setPlayer(Playerlist::getInstance()->getNeutral());
 
290
                        (*cit).setOwner(Playerlist::getInstance()->getNeutral());
285
291
                        (*cit).setBurnt(true);
286
292
                        break;
287
293
                      }
296
302
        }
297
303
      //and add it to the list
298
304
      past_citylists.push_back(clist);
299
 
      ObjectList<City> *new_clist = new ObjectList<City>(*clist);
 
305
      LocationList<City> *new_clist = new LocationList<City>(*clist);
300
306
      clist = new_clist;
301
307
      if (last_turn == true)
302
308
        break;
439
445
void HistoryReportDialog::addHistoryEvent(History *event)
440
446
{
441
447
  GraphicsCache *gc = GraphicsCache::getInstance();
442
 
  Player *p = event->getPlayer();
 
448
  Player *p = event->getOwner();
443
449
 
444
450
  Glib::ustring s = "";
445
451
  Gtk::TreeIter i = events_list->append();
621
627
      for (unsigned int i = 0; i < past_citylists.size(); i++)
622
628
        {
623
629
          Uint32 total_cities = 0;
624
 
          ObjectList<City>::iterator it = past_citylists[i]->begin();
 
630
          LocationList<City>::iterator it = past_citylists[i]->begin();
625
631
          for (; it != past_citylists[i]->end(); it++)
626
632
            {
627
 
              if ((*it).getPlayer() == *pit)
 
633
              if ((*it).getOwner() == *pit)
628
634
                total_cities++;
629
635
            }
630
636
          line.push_back(total_cities);