~widelands-dev/widelands/note_create_object2

« back to all changes in this revision

Viewing changes to src/logic/map_objects/immovable.cc

  • Committer: GunChleoc
  • Date: 2019-03-01 09:01:34 UTC
  • Revision ID: fios@foramnagaidhlig.net-20190301090134-ebjs5hry214iaqgc
NOCOM

Show diffs side-by-side

added added

removed removed

Lines of Context:
333
333
 * If this immovable was created by a building, 'former_building' can be set
334
334
 * in order to display information about it.
335
335
 */
336
 
Immovable& ImmovableDescr::create(EditorGameBase& egbase,
 
336
Immovable& ImmovableDescr::create(ObjectManager& objects,
337
337
                                  const Coords& coords,
338
338
                                  const BuildingDescr* former_building_descr) const {
339
339
        Immovable& result = *new Immovable(*this, former_building_descr);
340
340
        result.position_ = coords;
341
 
        result.init(egbase);
 
341
        result.init(objects);
342
342
        return result;
343
343
}
344
344
 
400
400
/**
401
401
 * Actually initialize the immovable.
402
402
 */
403
 
bool Immovable::init(EditorGameBase& egbase) {
404
 
        BaseImmovable::init(egbase);
405
 
 
406
 
        set_position(egbase, position_);
 
403
bool Immovable::init(ObjectManager& objects) {
 
404
        BaseImmovable::init(objects);
 
405
/* NOCOM
 
406
        set_position(objects, position_);
407
407
 
408
408
        //  Set animation data according to current program state.
409
409
        ImmovableProgram const* prog = program_;
412
412
                assert(prog != nullptr);
413
413
        }
414
414
        if (upcast(ImmovableProgram::ActAnimate const, act_animate, &(*prog)[program_ptr_]))
415
 
                start_animation(egbase, act_animate->animation());
 
415
                start_animation(objects, act_animate->animation());
416
416
 
417
 
        if (upcast(Game, game, &egbase)) {
 
417
        if (upcast(Game, game, &objects)) {
418
418
                switch_program(*game, "program");
419
419
        }
 
420
        */
420
421
        return true;
421
422
}
422
423
 
1309
1310
/**
1310
1311
 * Initialize the immovable.
1311
1312
 */
1312
 
bool PlayerImmovable::init(EditorGameBase& egbase) {
1313
 
        return BaseImmovable::init(egbase);
 
1313
bool PlayerImmovable::init(ObjectManager& objects) {
 
1314
        return BaseImmovable::init(objects);
1314
1315
}
1315
1316
 
1316
1317
/**