~ubuntu-branches/ubuntu/precise/lordsawar/precise

« back to all changes in this revision

Viewing changes to src/action.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2009-10-21 08:02:12 UTC
  • mfrom: (1.1.8 upstream) (5.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091021080212-wpmd6xdaxrgnn63y
Tags: 0.1.6-1
[ Barry deFreese ]
* New upstream release.
  + Drop libsdl-image1.2 from build-deps, no longer needed.
* Add README.source for quilt patch system.
* Clean up debian/copyright some.
* Bump Standards Version to 3.8.3. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
//
6
6
//  This program is free software; you can redistribute it and/or modify
7
7
//  it under the terms of the GNU General Public License as published by
8
 
//  the Free Software Foundation; either version 2 of the License, or
 
8
//  the Free Software Foundation; either version 3 of the License, or
9
9
//  (at your option) any later version.
10
10
//
11
11
//  This program is distributed in the hope that it will be useful,
21
21
#ifndef ACTION_H
22
22
#define ACTION_H
23
23
 
 
24
#include <gtkmm.h>
24
25
#include <string>
25
26
#include "vector.h"
26
27
#include <sigc++/trackable.h>
212
213
        //! Populate the move action with the stack and it's new position.
213
214
        bool fillData(Stack* s, Vector<int> dest);
214
215
    
215
 
        Uint32 getStackId() const {return d_stack;};
 
216
        guint32 getStackId() const {return d_stack;};
216
217
        Vector<int> getEndingPosition() const {return d_dest;};
217
218
        Vector<int> getPositionDelta() const {return d_delta;};
218
219
 
219
220
        private:
220
 
        Uint32 d_stack;
 
221
        guint32 d_stack;
221
222
        Vector<int> d_dest;
222
223
        Vector<int> d_delta;
223
224
};
249
250
        //! Populate the action with the Stack being removed.
250
251
        bool fillData(Stack* s);
251
252
    
252
 
        Uint32 getStackId() const {return d_stack;};
 
253
        guint32 getStackId() const {return d_stack;};
253
254
 
254
255
        private:
255
 
        Uint32 d_stack;
 
256
        guint32 d_stack;
256
257
};
257
258
 
258
259
//-----------------------------------------------------------------------------
293
294
        //! Populate the action with pertinent data.
294
295
        bool fillData(Stack* orig, Stack* added);
295
296
    
296
 
        Uint32 getStackId() const {return d_orig;};
297
 
        Uint32 getNewStackId() const {return d_added;};
298
 
        Uint32 getGroupedArmyId(int idx) const {return d_armies_moved[idx];};
 
297
        guint32 getStackId() const {return d_orig;};
 
298
        guint32 getNewStackId() const {return d_added;};
 
299
        guint32 getGroupedArmyId(int idx) const {return d_armies_moved[idx];};
299
300
        private:
300
 
        Uint32 d_orig, d_added;
301
 
        Uint32 d_armies_moved[MAX_STACK_SIZE];
 
301
        guint32 d_orig, d_added;
 
302
        guint32 d_armies_moved[MAX_STACK_SIZE];
302
303
};
303
304
 
304
305
//-----------------------------------------------------------------------------
335
336
 
336
337
 
337
338
        std::list<FightItem> getBattleHistory() const {return d_history;};
338
 
        std::list<Uint32> getAttackerArmyIds() const {return d_attackers;};
339
 
        std::list<Uint32> getDefenderArmyIds() const {return d_defenders;};
 
339
        std::list<guint32> getAttackerArmyIds() const {return d_attackers;};
 
340
        std::list<guint32> getDefenderArmyIds() const {return d_defenders;};
340
341
 
341
342
        private:
342
343
        
343
344
        std::list<FightItem> d_history;
344
 
        std::list<Uint32> d_attackers;
345
 
        std::list<Uint32> d_defenders;
 
345
        std::list<guint32> d_attackers;
 
346
        std::list<guint32> d_defenders;
346
347
 
347
348
        bool loadItem(std::string tag, XML_Helper* helper);
348
349
};
380
381
        //! Populate the action with pertinent data.
381
382
        bool fillData(Stack* orig, Stack* joining);
382
383
    
383
 
        Uint32 getReceivingStackId() const {return d_orig_id;};
384
 
        Uint32 getJoiningStackId() const {return d_joining_id;};
 
384
        guint32 getReceivingStackId() const {return d_orig_id;};
 
385
        guint32 getJoiningStackId() const {return d_joining_id;};
385
386
        private:
386
 
        Uint32 d_orig_id, d_joining_id;
 
387
        guint32 d_orig_id, d_joining_id;
387
388
};
388
389
 
389
390
//-----------------------------------------------------------------------------
421
422
        //! Set whether or not the Stack was successful in searching the ruin.
422
423
        void setSearched(bool searched) {d_searched = searched;}
423
424
    
424
 
        Uint32 getRuinId() const {return d_ruin;};
425
 
        Uint32 getStackId() const {return d_stack;};
 
425
        guint32 getRuinId() const {return d_ruin;};
 
426
        guint32 getStackId() const {return d_stack;};
426
427
        bool getSearchSuccessful() const {return d_searched;};
427
428
 
428
429
        private:
429
 
        Uint32 d_ruin;
430
 
        Uint32 d_stack;
 
430
        guint32 d_ruin;
 
431
        guint32 d_stack;
431
432
        bool d_searched;
432
433
};
433
434
 
464
465
        //! Populate the action with pertinent data.
465
466
        bool fillData(Temple* t, Stack* s);
466
467
    
467
 
        Uint32 getTempleId() const {return d_temple;};
468
 
        Uint32 getStackId() const {return d_stack;};
 
468
        guint32 getTempleId() const {return d_temple;};
 
469
        guint32 getStackId() const {return d_stack;};
469
470
 
470
471
        private:
471
 
        Uint32 d_temple;
472
 
        Uint32 d_stack;
 
472
        guint32 d_temple;
 
473
        guint32 d_stack;
473
474
};
474
475
 
475
476
 
503
504
        //! Populate the action with the City being occupied.
504
505
        bool fillData (City* c);
505
506
    
506
 
        Uint32 getCityId() const {return d_city;};
 
507
        guint32 getCityId() const {return d_city;};
507
508
 
508
509
        private:
509
 
        Uint32 d_city;
 
510
        guint32 d_city;
510
511
};
511
512
 
512
513
//-----------------------------------------------------------------------------
539
540
        //! Populate the action with the City that has been pillaged.
540
541
        bool fillData(City* c);
541
542
 
542
 
        Uint32 getCityId() const {return d_city;};
 
543
        guint32 getCityId() const {return d_city;};
543
544
 
544
545
        private:
545
 
        Uint32 d_city;
 
546
        guint32 d_city;
546
547
};
547
548
 
548
549
//-----------------------------------------------------------------------------
575
576
        //! Populate the action with the City that has been sacked.
576
577
        bool fillData(City* c);
577
578
 
578
 
        Uint32 getCityId() const {return d_city;};
 
579
        guint32 getCityId() const {return d_city;};
579
580
 
580
581
        private:
581
 
        Uint32 d_city;
 
582
        guint32 d_city;
582
583
};
583
584
 
584
585
//-----------------------------------------------------------------------------
610
611
        //! Populate the action with the City that has been razed.
611
612
        bool fillData (City* c);
612
613
    
613
 
        Uint32 getCityId() const {return d_city;};
 
614
        guint32 getCityId() const {return d_city;};
614
615
 
615
616
        private:
616
 
        Uint32 d_city;
 
617
        guint32 d_city;
617
618
};
618
619
 
619
620
//-----------------------------------------------------------------------------
645
646
        //! Populate the action with the City that has been upgraded.
646
647
        bool fillData(City* c);
647
648
 
648
 
        Uint32 getCityId() const {return d_city;};
 
649
        guint32 getCityId() const {return d_city;};
649
650
 
650
651
        private:
651
 
        Uint32 d_city;
 
652
        guint32 d_city;
652
653
};
653
654
 
654
655
//-----------------------------------------------------------------------------
691
692
        //! Populate the action with pertinent data.
692
693
        bool fillData(City* c, int slot, const ArmyProto *prod);
693
694
 
694
 
        Uint32 getCityId() const {return d_city;};
 
695
        guint32 getCityId() const {return d_city;};
695
696
        int getProductionSlot() const {return d_slot;};
696
697
        int getBoughtArmyTypeId() const {return d_prod;};
697
698
        private:
698
 
        Uint32 d_city;
 
699
        guint32 d_city;
699
700
        int d_slot, d_prod;
700
701
};
701
702
 
735
736
        //! Populate the action with pertinent data.
736
737
        bool fillData(City* c, int slot);
737
738
 
738
 
        Uint32 getCityId() const {return d_city;};
 
739
        guint32 getCityId() const {return d_city;};
739
740
        int getSlot() const {return d_prod;};
740
741
 
741
742
        private:
742
 
        Uint32 d_city;
 
743
        guint32 d_city;
743
744
        int d_prod;
744
745
};
745
746
 
778
779
    
779
780
 
780
781
        Reward *getReward() const {return d_reward;};
781
 
        Uint32 getStackId() const {return d_stack;};
 
782
        guint32 getStackId() const {return d_stack;};
782
783
 
783
784
        private:
784
785
        Reward *d_reward;
785
 
        Uint32 d_stack;
 
786
        guint32 d_stack;
786
787
 
787
788
        bool load(std::string tag, XML_Helper *helper);
788
789
        
816
817
        //! Populate the Action_Quest with a Quest.
817
818
        bool fillData(Quest* q);
818
819
 
819
 
        Uint32 getHeroId() const {return d_hero;};
820
 
        Uint32 getQuestType() const {return d_questtype;};
821
 
        Uint32 getData() const {return d_data;};
822
 
        Uint32 getVictimPlayerId() const {return d_victim_player;};
 
820
        guint32 getHeroId() const {return d_hero;};
 
821
        guint32 getQuestType() const {return d_questtype;};
 
822
        guint32 getData() const {return d_data;};
 
823
        guint32 getVictimPlayerId() const {return d_victim_player;};
823
824
 
824
825
        private:
825
 
        Uint32 d_hero;
826
 
        Uint32 d_questtype;
827
 
        Uint32 d_data;
828
 
        Uint32 d_victim_player; //victim player, only KILLARMIES uses this
 
826
        guint32 d_hero;
 
827
        guint32 d_questtype;
 
828
        guint32 d_data;
 
829
        guint32 d_victim_player; //victim player, only KILLARMIES uses this
829
830
};
830
831
 
831
832
//-----------------------------------------------------------------------------
870
871
        //! Populate the action with pertinent data.
871
872
        bool fillData(Hero *hero, Item *item, Slot slot, Vector<int> pos);
872
873
 
873
 
        Uint32 getHeroId() const {return d_hero;};
874
 
        Uint32 getItemId() const {return d_item;};
875
 
        Uint32 getToBackpackOrToGround() const {return d_slot;};
 
874
        guint32 getHeroId() const {return d_hero;};
 
875
        guint32 getItemId() const {return d_item;};
 
876
        guint32 getToBackpackOrToGround() const {return d_slot;};
876
877
        Vector<int> getItemPos() const {return d_pos;};
877
878
 
878
879
        private:
879
 
        Uint32 d_hero;
880
 
        Uint32 d_item;
881
 
        Uint32 d_slot;
 
880
        guint32 d_hero;
 
881
        guint32 d_item;
 
882
        guint32 d_slot;
882
883
        Vector<int> d_pos;
883
884
};
884
885
 
917
918
        //! Populate the action with pertinent data.
918
919
        bool fillData(Army *unit, Army::Stat raised);
919
920
 
920
 
        Uint32 getArmyId() const {return d_army;};
921
 
        Uint32 getStatToIncrease() const {return d_stat;};
 
921
        guint32 getArmyId() const {return d_army;};
 
922
        guint32 getStatToIncrease() const {return d_stat;};
922
923
 
923
924
        private:
924
 
        Uint32 d_army;
925
 
        Uint32 d_stat;
 
925
        guint32 d_army;
 
926
        guint32 d_stat;
926
927
};
927
928
 
928
929
//-----------------------------------------------------------------------------
955
956
        //! Populate the action with the signpost and the new message.
956
957
        bool fillData(Signpost * s, std::string message);
957
958
    
958
 
        Uint32 getSignpostId() const {return d_signpost;};
 
959
        guint32 getSignpostId() const {return d_signpost;};
959
960
        std::string getSignContents() const {return d_message;};
960
961
 
961
962
        private:
962
 
        Uint32 d_signpost;
 
963
        guint32 d_signpost;
963
964
        std::string d_message;
964
965
};
965
966
 
992
993
        //! Populate the action with the city being renamed and the new name.
993
994
        bool fillData(City *c, std::string name);
994
995
    
995
 
        Uint32 getCityId() const {return d_city;};
 
996
        guint32 getCityId() const {return d_city;};
996
997
        std::string getNewCityName() const {return d_name;};
997
998
        private:
998
 
        Uint32 d_city;
 
999
        guint32 d_city;
999
1000
        std::string d_name;
1000
1001
};
1001
1002
 
1034
1035
        //! Populate the action with pertinent data.
1035
1036
        bool fillData(City* src, Vector <int> dest);
1036
1037
    
1037
 
        Uint32 getCityId() const {return d_city;};
 
1038
        guint32 getCityId() const {return d_city;};
1038
1039
        Vector<int> getVectoringDestination() const {return d_dest;};
1039
1040
 
1040
1041
        private:
1041
 
        Uint32 d_city;
 
1042
        guint32 d_city;
1042
1043
        Vector<int> d_dest;
1043
1044
};
1044
1045
 
1068
1069
        virtual bool doSave(XML_Helper* helper) const;
1069
1070
 
1070
1071
        //! Populate the action with a list of ranks, one per Army unit type.
1071
 
        bool fillData(std::list<Uint32> order);
 
1072
        bool fillData(std::list<guint32> order);
1072
1073
    
1073
 
        std::list<Uint32> getFightOrder() const {return d_order;};
 
1074
        std::list<guint32> getFightOrder() const {return d_order;};
1074
1075
 
1075
1076
        private:
1076
 
        std::list<Uint32> d_order;
 
1077
        std::list<guint32> d_order;
1077
1078
};
1078
1079
 
1079
1080
//-----------------------------------------------------------------------------
1135
1136
        //! Populate the action with the Id of the Hero and the Id of the Item.
1136
1137
        bool fillData(Hero *hero, Item *item);
1137
1138
 
1138
 
        Uint32 getHeroId() const {return d_hero;};
1139
 
        Uint32 getItemId() const {return d_item;};
 
1139
        guint32 getHeroId() const {return d_hero;};
 
1140
        guint32 getItemId() const {return d_item;};
1140
1141
 
1141
1142
        private:
1142
 
        Uint32 d_hero;
1143
 
        Uint32 d_item;
 
1143
        guint32 d_hero;
 
1144
        guint32 d_item;
1144
1145
};
1145
1146
 
1146
1147
//-----------------------------------------------------------------------------
1187
1188
        ArmyProdBase * getArmy() const {return d_army;}
1188
1189
 
1189
1190
        //! Get the Id of the City that produced the Army unit.
1190
 
        Uint32 getCityId() const {return d_city;}
 
1191
        guint32 getCityId() const {return d_city;}
1191
1192
 
1192
1193
        //! Get whether or not the Army unit is being vectored elsewhere.
1193
1194
        bool getVectored() const {return d_vectored;}
1194
1195
    private:
1195
1196
        ArmyProdBase *d_army;
1196
 
        Uint32 d_city;
 
1197
        guint32 d_city;
1197
1198
        bool d_vectored;
1198
1199
 
1199
1200
        bool load(std::string tag, XML_Helper *helper);
1290
1291
        bool fillData(Player *player, Player::DiplomaticState state);
1291
1292
 
1292
1293
        //! Get the Id of the Player that we have entered a new state for.
1293
 
        Uint32 getOpponentId() const {return d_opponent_id;}
 
1294
        guint32 getOpponentId() const {return d_opponent_id;}
1294
1295
 
1295
1296
        //! Get the state that we're in with the other Player.
1296
1297
        Player::DiplomaticState getDiplomaticState() const
1297
1298
          {return d_diplomatic_state;};
1298
1299
    private:
1299
 
        Uint32 d_opponent_id;
 
1300
        guint32 d_opponent_id;
1300
1301
        Player::DiplomaticState d_diplomatic_state;
1301
1302
};
1302
1303
 
1336
1337
        bool fillData(Player *player, Player::DiplomaticProposal proposal);
1337
1338
 
1338
1339
        //! Get the Id of the Player that our proposal is for.
1339
 
        Uint32 getOpponentId() const {return d_opponent_id;}
 
1340
        guint32 getOpponentId() const {return d_opponent_id;}
1340
1341
 
1341
1342
        //! Get the proposal that we're offering.
1342
1343
        Player::DiplomaticProposal getDiplomaticProposal() const
1343
1344
          {return d_diplomatic_proposal;};
1344
1345
    private:
1345
 
        Uint32 d_opponent_id;
 
1346
        guint32 d_opponent_id;
1346
1347
        Player::DiplomaticProposal d_diplomatic_proposal;
1347
1348
};
1348
1349
 
1384
1385
        bool fillData(Player *player, int amount);
1385
1386
 
1386
1387
        //! Get the Id of the Player that our opinion has changed of.
1387
 
        Uint32 getOpponentId() const {return d_opponent_id;}
 
1388
        guint32 getOpponentId() const {return d_opponent_id;}
1388
1389
 
1389
1390
        //! Get the amount of the opinion change.
1390
1391
        int getAmountChange() const {return d_amount;};
1391
1392
    private:
1392
 
        Uint32 d_opponent_id;
 
1393
        guint32 d_opponent_id;
1393
1394
        int d_amount;
1394
1395
};
1395
1396
 
1437
1438
        //! Populate the action with the City being conquered.
1438
1439
        bool fillData (City* c, Stack *s);
1439
1440
    
1440
 
        Uint32 getCityId() const {return d_city;};
1441
 
        Uint32 getStackId() const {return d_stack;};
 
1441
        guint32 getCityId() const {return d_city;};
 
1442
        guint32 getStackId() const {return d_stack;};
1442
1443
        private:
1443
 
        Uint32 d_city, d_stack;
 
1444
        guint32 d_city, d_stack;
1444
1445
};
1445
1446
 
1446
1447
//-----------------------------------------------------------------------------
1467
1468
        bool fillData(HeroProto* hero, City *city, int cost, int alliesCount, const ArmyProto *ally);
1468
1469
    
1469
1470
        HeroProto* getHero() const {return d_hero;};
1470
 
        Uint32 getCityId() const {return d_city;};
1471
 
        Uint32 getCost() const {return d_cost;};
1472
 
        Uint32 getNumAllies() const {return d_allies;};
1473
 
        Uint32 getAllyArmyType() const {return d_ally_army_type;};
 
1471
        guint32 getCityId() const {return d_city;};
 
1472
        guint32 getCost() const {return d_cost;};
 
1473
        guint32 getNumAllies() const {return d_allies;};
 
1474
        guint32 getAllyArmyType() const {return d_ally_army_type;};
1474
1475
 
1475
1476
        private:
1476
1477
        HeroProto *d_hero;
1477
 
        Uint32 d_city, d_cost, d_allies, d_ally_army_type;
 
1478
        guint32 d_city, d_cost, d_allies, d_ally_army_type;
1478
1479
 
1479
1480
        bool load(std::string tag, XML_Helper *helper);
1480
1481
};
1531
1532
        //! Populate the action.
1532
1533
        bool fillData(City *city, const ArmyProdBase *army);
1533
1534
    
1534
 
        Uint32 getCityId() const {return d_city;}
1535
 
        Uint32 getArmyType() const {return d_army_type;}
 
1535
        guint32 getCityId() const {return d_city;}
 
1536
        guint32 getArmyType() const {return d_army_type;}
1536
1537
 
1537
1538
        private:
1538
 
        Uint32 d_city;
1539
 
        Uint32 d_army_type;
 
1539
        guint32 d_city;
 
1540
        guint32 d_army_type;
1540
1541
};
1541
1542
 
1542
1543
//-----------------------------------------------------------------------------
1588
1589
        virtual bool doSave(XML_Helper* helper) const;
1589
1590
 
1590
1591
        //! Populate the action with the players involved and the amounts.
1591
 
        bool fillData(Player *looter, Player *looted, Uint32 amount_to_add,
1592
 
                      Uint32 amount_to_subtract);
 
1592
        bool fillData(Player *looter, Player *looted, guint32 amount_to_add,
 
1593
                      guint32 amount_to_subtract);
1593
1594
 
1594
 
        Uint32 getAmountToAdd() const { return d_gold_added;};
1595
 
        Uint32 getAmountToSubtract() const { return d_gold_removed;};
1596
 
        Uint32 getLootingPlayerId() const {return d_looting_player_id;};
1597
 
        Uint32 getLootedPlayerId() const {return d_looted_player_id;};
 
1595
        guint32 getAmountToAdd() const { return d_gold_added;};
 
1596
        guint32 getAmountToSubtract() const { return d_gold_removed;};
 
1597
        guint32 getLootingPlayerId() const {return d_looting_player_id;};
 
1598
        guint32 getLootedPlayerId() const {return d_looted_player_id;};
1598
1599
 
1599
1600
        private:
1600
 
        Uint32 d_looting_player_id;
1601
 
        Uint32 d_looted_player_id;
1602
 
        Uint32 d_gold_added;
1603
 
        Uint32 d_gold_removed;
 
1601
        guint32 d_looting_player_id;
 
1602
        guint32 d_looted_player_id;
 
1603
        guint32 d_gold_added;
 
1604
        guint32 d_gold_removed;
1604
1605
};
1605
1606
 
1606
1607
#endif //ACTION_H