~ubuntu-branches/ubuntu/trusty/enigma/trusty-proposed

« back to all changes in this revision

Viewing changes to src/world_internal.hh

  • Committer: Package Import Robot
  • Author(s): Erich Schubert
  • Date: 2013-04-06 14:54:02 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130406145402-jgjrtk7hac8gtvza
Tags: 1.20-dfsg.1-1
* New upstream release (Closes: #704595)
  (Repacked: dropped zipios++ source and main menu music)
* Update watch file, sf.net again.
* Fix documentation links (Closes: #653508)
* Conflict with enigma-level-previews to encourage deinstallation
  (Pregenerated level previews were only used with version 1.01)
* Use dh7 for building instead of CDBS
* Update to policy 3.9.4.0 (no changes)
* Register documentation with doc-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        V2 get_force(Actor *a) {
51
51
            if (a->is_flying() || a->is_dead())
52
52
                return V2();
53
 
            else 
 
53
            else
54
54
                return force * a->get_mouseforce();
55
55
        }
56
56
 
89
89
        DelayedImpulse& operator = (const DelayedImpulse& other); // forbidden
90
90
    public:
91
91
        DelayedImpulse(const Impulse& impulse_, double delay_, const Stone *receiver_)
92
 
                : impulse(impulse_), delay(delay_), receiver(receiver_), 
 
92
                : impulse(impulse_), delay(delay_), receiver(receiver_),
93
93
                isReferenced(false), isObsolete(false) {}
94
94
 
95
95
        DelayedImpulse(const DelayedImpulse& other)
110
110
        bool is_sender(const Stone *target) const {
111
111
            return target == impulse.sender;
112
112
        }
113
 
        
 
113
 
114
114
        bool is_referenced() const {
115
115
            return isReferenced;
116
116
        }
117
 
        
 
117
 
118
118
        void mark_referenced(bool state) {
119
119
            isReferenced =  state;
120
120
        }
121
 
        
 
121
 
122
122
        bool is_obsolete() const {
123
123
            return isObsolete;
124
124
        }
125
 
        
 
125
 
126
126
        void mark_obsolete() {
127
127
            isObsolete = true;
128
128
        }
138
138
            //
139
139
            // Possible fix : add unique ID to all objects
140
140
 
141
 
            if (is_receiver(target)) { 
 
141
            if (is_receiver(target)) {
142
142
                // if object did not change since impulse was initiated
143
143
                target->on_impulse(impulse);
144
144
            }
175
175
    public:
176
176
        Floor *yield(GridPos p) {
177
177
            Floor *f = Layer<Floor>::yield(p);
178
 
            if (Value v = f->getAttr("name")) {
179
 
                NamePosition(p, v.to_string());
 
178
            if (f != NULL) {
 
179
                if (Value v = f->getAttr("name")) {
 
180
                    NamePosition(p, v.to_string());
 
181
                }
180
182
            }
181
183
            return f;
182
184
        }
183
 
        
 
185
 
184
186
        void set(GridPos p, Floor *x) {
185
187
            Floor *f = get(p);
186
188
            if (f != NULL) {
190
192
            }
191
193
            Layer<Floor>::set(p, x);
192
194
        }
193
 
        
 
195
 
194
196
        Floor *raw_get(Field &f) { return f.floor; }
195
197
        void raw_set(Field &f, Floor *x) { f.floor = x;}
196
198
    };
279
281
        void namePosition(Value po, const std::string &name);
280
282
        Value getNamedPosition(const std::string &name);
281
283
        PositionList getPositionList(const std::string &tmpl, Object *reference = NULL);
282
 
        
 
284
 
283
285
        void tick (double dtime);
284
286
        void remove (ForceField *ff);
285
287
 
303
305
 
304
306
        void advance_actor (Actor *a, double &dt);
305
307
        void move_actors (double dtime);
306
 
        void find_contact_with_stone(Actor *a, GridPos p, StoneContact &c, 
 
308
        void find_contact_with_stone(Actor *a, GridPos p, StoneContact &c,
307
309
                DirectionBits winFacesActorStone = NODIRBIT,
308
310
                bool isRounded = true, Stone *st = NULL);
309
 
        void find_contact_with_edge(Actor *a, GridPos pe, GridPos p1, GridPos p2, 
 
311
        void find_contact_with_edge(Actor *a, GridPos pe, GridPos p1, GridPos p2,
310
312
                StoneContact &c0, StoneContact &c1, StoneContact &c2,
311
313
                DirectionBits winFacesActorStone = NODIRBIT);
312
314
        void find_contact_with_window(Actor *a, GridPos p, StoneContact &c0, StoneContact &c1,
322
324
        void doPerformPendingActions();
323
325
 
324
326
    public:
325
 
    
326
 
        static const double contact_e;  // epsilon distant limit for contacts 
 
327
 
 
328
        static const double contact_e;  // epsilon distant limit for contacts
327
329
 
328
330
        /* ---------- Variables ---------- */
329
331
 
332
334
        ForceList            forces;
333
335
        ActorList            actorlist; // List of movable, dynamic objects
334
336
        Actor               *leftmost_actor;   // sorted double linked list of actors
335
 
        Actor               *rightmost_actor;  
 
337
        Actor               *rightmost_actor;
336
338
        OtherList            others;
337
339
        RubberbandList       rubberbands;
338
340
        MouseForce           m_mouseforce;
339
341
        ecl::V2              globalForce;
340
342
        int                  scrambleIntensity;
341
 
        int                  numMeditatists; 
 
343
        int                  numMeditatists;
342
344
        int                  indispensableHollows;
343
345
        int                  engagedIndispensableHollows;
344
346
        int                  engagedDispensableHollows;
363
365
 
364
366
        list<Scramble> scrambles;
365
367
    };
366
 
    
 
368
 
367
369
} // namespace enigma
368