~widelands-dev/widelands/trunk

« back to all changes in this revision

Viewing changes to src/logic/findnode.cc

  • Committer: Nicolai Hähnle
  • Date: 2010-10-31 12:50:41 UTC
  • mto: (5614.3.1 campaigns)
  • mto: This revision was merged to the branch mainline in revision 5692.
  • Revision ID: prefect_@gmx.net-20101031125041-z0qh421qs7gjix50
Initial cut of ship construction, untested, without proper savegame support

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include "field.h"
23
23
#include "immovable.h"
 
24
#include "map.h"
24
25
#include "wexception.h"
25
26
 
26
27
#include "container_iterate.h"
127
128
                coord.field->get_starting_res_amount();
128
129
}
129
130
 
 
131
bool FindNodeShore::accept(Map const & map, FCoords const & coord) const
 
132
{
 
133
        if (!(coord.field->nodecaps() & MOVECAPS_WALK))
 
134
                return false;
 
135
 
 
136
        for (Direction dir = FIRST_DIRECTION; dir <= LAST_DIRECTION; ++dir) {
 
137
                FCoords neighb = map.get_neighbour(coord, dir);
 
138
                if (neighb.field->nodecaps() & MOVECAPS_SWIM)
 
139
                        return true;
 
140
        }
 
141
 
 
142
        return false;
 
143
}
 
144
 
130
145
}