~chuckw20/widelands/New_atlantean_carrier_animations

« back to all changes in this revision

Viewing changes to src/logic/bob.h

  • Committer: Nicolai Hähnle
  • Date: 2010-05-09 11:21:24 UTC
  • mfrom: (5141.1.7 bob-saving)
  • Revision ID: prefect_@gmx.net-20100509112124-14ap938z6yuqy38j
Merge branch bob-saving

All classes derived from Bob now use the new save system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef BOB_H
21
21
#define BOB_H
22
22
 
 
23
#include "economy/route.h"
23
24
#include "graphic/animation.h"
24
25
#include "graphic/encodedata.h"
25
26
#include "point.h"
170
171
                        coords  (Coords::Null()),
171
172
                        diranims(0),
172
173
                        path    (0),
173
 
                        transfer(0),
174
174
                        route   (0),
175
175
                        program (0)
176
176
                {}
185
185
                Coords                 coords;
186
186
                const DirAnimations  * diranims;
187
187
                Path                 * path;
188
 
                Transfer             * transfer;
189
188
                Route                * route;
190
189
                const BobProgramBase * program; ///< pointer to current program
191
190
        };
387
386
        bool m_actscheduled;
388
387
        bool m_in_act; ///< if do_act is currently running
389
388
        std::string m_signal;
 
389
 
 
390
        // saving and loading
 
391
protected:
 
392
        class Loader : public Map_Object::Loader {
 
393
        public:
 
394
                Loader();
 
395
 
 
396
                void load(FileRead &);
 
397
                virtual void load_pointers();
 
398
                virtual void load_finish();
 
399
 
 
400
        protected:
 
401
                virtual const Task * get_task(const std::string& name);
 
402
                virtual const BobProgramBase * get_program(const std::string& name);
 
403
 
 
404
        private:
 
405
                struct LoadState {
 
406
                        uint32_t objvar1;
 
407
                        Route::LoadData route;
 
408
                };
 
409
 
 
410
                std::vector<LoadState> states;
 
411
        };
 
412
 
 
413
public:
 
414
        virtual bool has_new_save_support() {return true;}
 
415
 
 
416
        virtual void save(Editor_Game_Base &, Map_Map_Object_Saver &, FileWrite &);
 
417
        // Pure Bobs cannot be loaded
390
418
};
391
419
 
392
420
}
393
421
 
394
422
#endif
395