123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- #ifndef __OREBEL_H
- #define __OREBEL_H
- #ifndef __ODYNARRB_H
- #include <ODYNARRB.h>
- #endif
- enum { REBEL_IDLE=1,
- REBEL_ATTACK_TOWN,
- REBEL_ATTACK_FIRM,
- REBEL_SETTLE_NEW,
- REBEL_SETTLE_TO,
- };
- #pragma pack(1)
- class Rebel
- {
- public:
- short rebel_recno;
- short leader_unit_recno;
- char action_mode;
- short action_para;
- short action_para2;
- short mobile_rebel_count;
- short town_recno;
- char hostile_nation_bits;
- public:
- Rebel();
- ~Rebel();
- void next_day();
- void join(int unitRecno);
- void set_action(int actionMode, int actionPara=0, int actionPara2=0)
- { action_mode = actionMode, action_para = actionPara; action_para2 = actionPara2; }
- void town_being_attacked(int attackerUnitRecno);
- void set_hostile_nation(short nationRecno);
- void reset_hostile_nation(short nationRecno);
- int is_hostile_nation(short nationRecno);
- public:
- void think_new_action();
- void think_cur_action();
- void think_town_action();
- int think_settle_new();
- int think_settle_to();
- int think_capture_attack_town();
- int think_attack_firm();
- void execute_new_action();
- void stop_all_rebel_unit();
- void turn_indepedent();
- int select_new_leader();
- void process_leader_quit();
-
- UCHAR crc8();
- void clear_ptr();
-
- };
- #pragma pack()
- class RebelArray : public DynArrayB
- {
- public:
- short rebel_count;
- public:
- RebelArray();
- ~RebelArray();
- void init();
- void deinit();
- int create_rebel(int unitRecno, int hostileNationRecno, int actionMode=REBEL_IDLE, int actionPara=0);
- void del_rebel(int rebelRecno);
- void drop_rebel_identity(int unitRecno);
- void settle_town(int unitRecno, int townRecno);
- void next_day();
- void stop_attack_town(short townRecno);
- void stop_attack_firm(short firmRecno);
- void stop_attack_nation(short nationRecno);
-
- int write_file(File* filePtr);
- int read_file(File* filePtr);
-
- #ifdef DEBUG
- Rebel* operator[](int recNo);
- #else
- Rebel* operator[](int recNo) { return (Rebel*) get_ptr(recNo); }
- #endif
- int is_deleted(int recNo) { return get_ptr(recNo) == NULL; }
- };
- extern RebelArray rebel_array;
- #endif
|