25 #include "../vehicle.h"
26 #include "../gamemap.h"
31 this->type = mineType;
33 this->strength = strength;
35 mapNetworkIdCounterAfter = -1;
36 mapNetworkIdCounterBefore = -1;
42 return "Spawn mine at position " + pos.
toString();
57 stackPosition = stream.
readInt();
59 mapNetworkIdCounterBefore = stream.
readInt();
60 mapNetworkIdCounterAfter = stream.
readInt();
73 stream.
writeInt( mapNetworkIdCounterBefore );
74 stream.
writeInt( mapNetworkIdCounterAfter );
91 bool result = fld->
putmine( owner, type, strength );
97 stackPosition = fld->
mines.size();
110 if ( fld->
mines.size() != stackPosition )
118 fld->
mines.pop_back();
127 if (
getMap()->idManager.unitnetworkid != mapNetworkIdCounterAfter )
virtual void writeInt(int i)
Writes a 32 bit signed Integer. In the stream little-endian byte order is used and a translation is p...
bool putmine(int owner, MineTypes typ, int strength)
put a mine of type typ for player owner and a punch of strength on the field. Strength is an absolute...
virtual int readInt(void)
Reads a 32 bit signed Integer. In the stream little-endian byte order is used and a translation is pe...
virtual GameActionID getID() const
virtual void writeData(tnstream &stream) const
virtual ActionResult runAction(const Context &context)
void read(tnstream &stream)
ASCString toString(bool coordinates=false) const
The interface for all kinds of IO stream.
a single field of the map
static const int mineDataVersion
The ASCString class provides an abstract way to manipulate strings.
void write(tnstream &stream) const
Coordinate on the twodimensional map.
ASCString getDescription() const
virtual ActionResult undoAction(const Context &context)
class GameMap::IDManager idManager
virtual ActionResult verify()
A GameAction is an modification of something on a map.
virtual void readData(tnstream &stream)
The map. THE central structure of ASC, which holds everything not globally available together...
MapField * getField(int x, int y)