Advanced Strategic Command
gameevents.h
Go to the documentation of this file.
1 
5 /*
6  This file is part of Advanced Strategic Command; http://www.asc-hq.de
7  Copyright (C) 1994-2010 Martin Bickel and Marc Schellenberger
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; see the file COPYING. If not, write to the
21  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
22  Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef gameeventsH
27 #define gameeventsH
28 
29 #include "typen.h"
30 #include "gameeventsystem.h"
31 #include "mappolygons.h"
32 
33 #include "actions/context.h"
34 
35 // The new event system here is not yet functional
36 
37 // namespace GameEvents {
38 
39 
58 
59 
82 
83 
84 class EventTriggered;
85 
87  GameMap*& gameMap;
88  public:
89  typedef vector<MapCoordinate> Fields;
90  typedef vector< Poly_gon > Polygons;
91 
92  void setField ( const MapCoordinate& pos );
93  void setPolygon ( const Poly_gon& poly_gon );
94  void setGlobal();
95  virtual ~FieldAddressing() {};
96 
97  protected:
98  FieldAddressing( GameMap*& gamemap ) : gameMap(gamemap), addressingMode( none ) {};
100 
104 
105  void readMapModificationData ( tnstream& stream );
106  void writeMapModificationData ( tnstream& stream );
107  virtual void fieldOperator( const MapCoordinate& mc ) = 0;
108  void operate();
109  void setpointabs ( int x, int y );
110 
111  void setup();
112  friend Event* readOldEvent( tnstream* stream, GameMap* gamemap, map<int,int>& eventTranslation, map<EventTriggered*,int>& eventTriggerEvents );
113 };
114 
115 
116 
117 class TriggerNothing : public EventTrigger {
118  public:
120  virtual void readData ( tnstream& stream ) ;
121  virtual void writeData ( tnstream& stream ) ;
122  void setup() {};
123 };
124 
126  protected:
127  State getState( int player ) { return finally_fulfilled; };
128  public:
130  ASCString getTypeName() const { return "Nothing (always true)"; };
131  ASCString getDetailledName() const { return getTypeName(); };
132 };
133 
135  protected:
136  State getState( int player ) { return finally_failed; };
137  public:
139  ASCString getTypeName() const { return "Nothing (always false)"; };
140  ASCString getDetailledName() const { return getTypeName(); };
141 };
142 
143 
144 
145 class TurnPassed : public EventTrigger {
146  int turn;
147  int move;
148  protected:
149  virtual State getState( int player );
150  public:
151  TurnPassed() : EventTrigger ( Trigger_TurnPassed ), turn( -1 ), move( -1 ) {};
152  TurnPassed( int turn_, int move_ ) : EventTrigger ( Trigger_TurnPassed ), turn( turn_ ), move( move_ ) {};
153 
154  virtual void readData ( tnstream& stream ) ;
155  virtual void writeData ( tnstream& stream ) ;
156  ASCString getTypeName() const;
157  ASCString getDetailledName() const;
158  void setup();
159  void arm();
160 };
161 
162 
163 class UnitTrigger : public EventTrigger, public sigc::trackable {
164  protected:
165  int unitID;
166  public:
167  UnitTrigger( EventTriggerID id ) : EventTrigger ( id ), unitID ( -1 ) {};
168 
169  virtual void readData ( tnstream& stream ) ;
170  virtual void writeData ( tnstream& stream ) ;
171  ASCString getName() const;
172  void setup();
173  void triggered();
174 };
175 
176 
177 class UnitLost : public UnitTrigger {
178  protected:
179  virtual State getState( int player );
180  public:
182  UnitLost( int unitID_) : UnitTrigger ( Trigger_UnitLost ) { unitID = unitID_;};
183  ASCString getTypeName() const;
184  ASCString getDetailledName() const;
185  void arm();
186 };
187 
188 class UnitConquered : public UnitTrigger {
189  protected:
190  virtual State getState( int player );
191  public:
193  UnitConquered( int unitID_) : UnitTrigger ( Trigger_UnitConquered ) { unitID = unitID_;};
194  ASCString getTypeName() const;
195  ASCString getDetailledName() const;
196  void arm();
197 };
198 
199 class UnitDestroyed : public UnitTrigger {
200  protected:
201  virtual State getState( int player );
202  public:
204  UnitDestroyed( int unitID_) : UnitTrigger ( Trigger_UnitDestroyed ) { unitID = unitID_;};
205  ASCString getTypeName() const;
206  ASCString getDetailledName() const;
207  void arm();
208 };
209 
210 
211 
213  protected:
214  virtual State getState( int player );
215  public:
217 
218  virtual void readData ( tnstream& stream ) { stream.readInt(); };
219  virtual void writeData ( tnstream& stream ) { stream.writeInt(1); };
220  ASCString getTypeName() const;
221  ASCString getDetailledName() const;
222  void setup() {};
223 };
224 
225 class AllUnitsLost : public EventTrigger {
226  protected:
227  virtual State getState( int player );
228  public:
230 
231  virtual void readData ( tnstream& stream ) { stream.readInt(); };
232  virtual void writeData ( tnstream& stream ) { stream.writeInt(1); };
233  ASCString getTypeName() const;
234  ASCString getDetailledName() const;
235  void setup() {};
236 };
237 
238 
240  protected:
243  public:
244  virtual void readData ( tnstream& stream ) ;
245  virtual void writeData ( tnstream& stream ) ;
246 };
247 
249  protected:
251  public:
252  ASCString getName() const;
253  void setup();
254 };
255 
256 
257 class BuildingConquered : public BuildingPositionTrigger, public sigc::trackable {
258  protected:
260  virtual State getState( int player );
261  public:
264  ASCString getTypeName() const { return "Building conquered"; };
265  ASCString getDetailledName() const { return BuildingPositionTrigger::getName() + " conquered"; };
266  void arm();
267  void triggered();
268 };
269 
271  protected:
272  virtual State getState( int player );
273  public:
275  BuildingLost( const MapCoordinate& position) : BuildingConquered( position ) {};
276  ASCString getTypeName() const { return "Building lost"; };
277  ASCString getDetailledName() const { return BuildingPositionTrigger::getName() + " conquered"; };
278  void arm();
279 };
280 
282  protected:
283  virtual State getState( int player );
284  public:
287  ASCString getTypeName() const { return "Building destroyed"; };
288  ASCString getDetailledName() const { return BuildingPositionTrigger::getName() + " destroyed"; };
289 };
290 
291 class BuildingSeen : public BuildingPositionTrigger, public sigc::trackable {
292  protected:
293  virtual State getState( int player );
294  public:
297  ASCString getTypeName() const { return "Building seen"; };
299  void arm();
300  void triggered();
301 };
302 
303 class EventTriggered : public EventTrigger, public sigc::trackable {
304  int eventID;
305  Event* getTargetEventName() const;
306  protected:
307  virtual State getState( int player );
308  public:
309  EventTriggered( int eventID_ = -1 ) : EventTrigger ( Trigger_EventTriggered ), eventID( eventID_ ) {};
310  void setEventID( int eventID_ ) { eventID = eventID_; };
311 
312  virtual void readData ( tnstream& stream );
313  virtual void writeData ( tnstream& stream );
314  ASCString getTypeName() const;
315  ASCString getDetailledName() const;
316  void setup();
317  void arm();
318  void triggered();
319 };
320 
321 class AllEnemyUnitsDestroyed : public EventTrigger, public sigc::trackable {
322  private:
323  void triggered();
324  protected:
325  virtual State getState( int player );
326  public:
328 
329  virtual void readData ( tnstream& stream ) { stream.readInt(); };
330  virtual void writeData ( tnstream& stream ) { stream.writeInt(1); };
331 
332  ASCString getTypeName() const;
333  ASCString getDetailledName() const;
334  void setup() {};
335  void arm();
336 };
337 
338 class AllEnemyBuildingsDestroyed : public EventTrigger, public sigc::trackable {
339  private:
340  void triggered();
341  protected:
342  virtual State getState( int player );
343  public:
345 
346  virtual void readData ( tnstream& stream ) { stream.readInt(); };
347  virtual void writeData ( tnstream& stream ) { stream.writeInt(1); };
348  ASCString getTypeName() const;
349  ASCString getDetailledName() const;
350  void setup() {};
351  void arm();
352 };
353 
354 class SpecificUnitEntersPolygon : public EventTrigger, public FieldAddressing, public sigc::trackable {
355  int unitID;
356  bool found;
357  bool arming;
358  protected:
359  virtual State getState( int player );
360  public:
361  SpecificUnitEntersPolygon( int unitID_ = -1 ) : EventTrigger ( Trigger_SpecificUnitEntersPolygon ), FieldAddressing(gamemap),unitID( unitID_ ), found(false), arming(false) {};
362 
363  virtual void readData ( tnstream& stream );
364  virtual void writeData ( tnstream& stream );
365  void setup();
366  void arm();
367  void triggered(const Context& context);
368  ASCString getTypeName() const;
369  ASCString getDetailledName() const;
370 
371  protected:
372  void fieldOperator( const MapCoordinate& mc );
373 };
374 
375 class AnyUnitEntersPolygon : public EventTrigger, public FieldAddressing, public sigc::trackable {
376  int player;
377  bool found;
378  bool arming;
379  protected:
380  virtual State getState( int player );
381  public:
382  AnyUnitEntersPolygon( int player_ = 0 ) : EventTrigger ( Trigger_AnyUnitEntersPolygon ), FieldAddressing(gamemap), player( player_ ), found(false), arming(false) {};
383 
384  virtual void readData ( tnstream& stream );
385  virtual void writeData ( tnstream& stream );
386  void setup();
387  void arm();
388  void triggered(const Context& context );
389  ASCString getTypeName() const;
390  ASCString getDetailledName() const;
391 
392  protected:
393  void fieldOperator( const MapCoordinate& mc );
394 };
395 
396 
397 class ResourceTribute : public EventTrigger, public sigc::trackable {
398  Resources demand;
399  int payingPlayer;
400  protected:
401  virtual State getState( int player );
402  public:
403 
404  ResourceTribute() : EventTrigger ( Trigger_ResourceTribute ), payingPlayer( -1 ) {};
405 
406  virtual void readData ( tnstream& stream );
407  virtual void writeData ( tnstream& stream );
408  ASCString getTypeName() const;
409  ASCString getDetailledName() const;
410  void setup();
411  void arm();
412  void triggered();
413 };
414 
415 
416 
417 
418 
420  public:
422 
423  void readData ( tnstream& stream );
424  void writeData ( tnstream& stream );
425 
426  void execute( MapDisplayInterface* md ) {};
427  void setup() {};
428 
429  ASCString getName() const { return "-nothing-"; };
430 
431 };
432 
433 
434 class WindChange: public EventAction {
435  int speed;
436  int direction;
437  public:
439  speed(0),
440  direction(0){};
441 
443  speed ( Speed ),
444  direction ( Direction ) {};
445 
446  void readData ( tnstream& stream );
447  void writeData ( tnstream& stream );
448 
449  void execute( MapDisplayInterface* md );
450  void setup();
451 
452  ASCString getName() const { return "Wind change"; };
453 
454 };
455 
457  int parameterNum;
458  int parameterValue;
459  int selectgameparameter( int para );
460 
461  public:
463  parameterNum(-1),
464  parameterValue(0){};
465 
466  ChangeGameParameter( int ParameterNum, int ParameterValue): EventAction( EventAction_ChangeGameParameter ),
467  parameterNum(ParameterNum),
468  parameterValue(ParameterValue){};
469 
470  void readData ( tnstream& stream );
471  void writeData ( tnstream& stream );
472 
473  void execute( MapDisplayInterface* md );
474  void setup();
475 
476  ASCString getName() const { return "Change game parameter"; };
477 
478 };
479 
481  int messageNum;
482 
483  void viewtextmessage ( GameMap* actmap, int id, int player );
484 
485  public:
487  messageNum(-1) {};
489  messageNum( messageNumber ) {};
490  void readData ( tnstream& stream );
491  void writeData ( tnstream& stream );
492 
493  void execute( MapDisplayInterface* md );
494 
495  void setup();
496 
497  ASCString getName() const { return "Display Message (from text file)"; };
498 };
499 
500 
502  protected:
504  public:
505  void execute( MapDisplayInterface* md );
506 };
507 
509  int weather;
510  protected:
511  void fieldOperator( const MapCoordinate& mc );
512  public:
514  weather( weather_ ) {};
515  void readData ( tnstream& stream );
516  void writeData ( tnstream& stream );
517 
518  void setup();
519 
520  ASCString getName() const { return "Weather change"; };
521 
522 };
523 
525  int terrainID;
526  protected:
527  void fieldOperator( const MapCoordinate& mc );
528  public:
530  terrainID( terrainID_ ) {};
531  void readData ( tnstream& stream );
532  void writeData ( tnstream& stream );
533  void setup();
534 
535  ASCString getName() const { return "Map Change"; };
536 };
537 
539  int objectID;
540  protected:
541  void fieldOperator( const MapCoordinate& mc );
542  public:
544  objectID(-1) {};
546  objectID(objectID_) {};
547  void readData ( tnstream& stream );
548  void writeData ( tnstream& stream );
549  void setup();
550 
551  ASCString getName() const { return "Add object"; };
552 };
553 
554 
556  public:
558 
559  void readData ( tnstream& stream ) {};
560  void writeData ( tnstream& stream ) {};
561 
562  void execute( MapDisplayInterface* md );
563  void setup() {};
564 
565  ASCString getName() const { return "map change completed"; };
566 
567 };
568 
569 
571  int damage;
572  MapCoordinate position;
573  public:
575  damage(0) {};
577  damage(dam), position(pos) {};
578 
579  void readData ( tnstream& stream );
580  void writeData ( tnstream& stream );
581 
582  void execute( MapDisplayInterface* md );
583  void setup();
584 
585  ASCString getName() const { return "Change building damage"; };
586 };
587 
588 class NextMap : public EventAction {
589  int mapID;
590  public:
592  NextMap( int mapID_ ) : EventAction ( EventAction_NextMap ), mapID(mapID_) {};
593 
594  void readData ( tnstream& stream );
595  void writeData ( tnstream& stream );
596 
597  void execute( MapDisplayInterface* md );
598  void setup();
599 
600  ASCString getName() const { return "Next Map in Campaign"; };
601 
602 };
603 
604 class LoseMap : public EventAction {
605  public:
607 
608  void readData ( tnstream& stream ) {};
609  void writeData ( tnstream& stream ) {};
610 
611  void execute( MapDisplayInterface* md );
612  void setup() {};
613 
614  ASCString getName() const { return "Lose Map"; };
615 
616 };
617 
618 class DisplayEllipse : public EventAction {
619  int x1,y1,x2,y2;
620  bool alignRight;
621  bool alignBottom;
622  public:
624  x1(-1),y1(-1),x2(-1),y2(-1),
625  alignRight(false),alignBottom(false) {};
626  DisplayEllipse(int x1_, int y1_, int x2_, int y2_, bool alignRight_, bool alignBottom_): EventAction( EventAction_DisplayEllipse ),
627  x1(x1_),y1(y1_),x2(x2_),y2(y2_),
628  alignRight(alignRight_),alignBottom(alignBottom_) {};
629 
630  void readData ( tnstream& stream );
631  void writeData ( tnstream& stream );
632 
633  void execute( MapDisplayInterface* md );
634  void setup();
635 
636  ASCString getName() const { return "Display Ellipse (legacy event)"; };
637 
638 };
639 
640 class RemoveEllipse : public EventAction {
641  public:
643 
644  void readData ( tnstream& stream ) {};
645  void writeData ( tnstream& stream ) {};
646 
647  void execute( MapDisplayInterface* md );
648  void setup() {};
649 
650  ASCString getName() const { return "Remove ellipse (legacy event)"; };
651 
652 };
653 
655  protected:
656  void fieldOperator( const MapCoordinate& mc );
657  public:
659  void readData ( tnstream& stream );
660  void writeData ( tnstream& stream );
661  void setup();
662 
663  ASCString getName() const { return "Remove all objects"; };
664 
665 };
666 
668  MapCoordinate pos;
669  int newOwner;
670  public:
672 
673  void readData ( tnstream& stream );
674  void writeData ( tnstream& stream );
675 
676  void execute( MapDisplayInterface* md );
677  void setup();
678 
679  ASCString getName() const { return "Change Building Owner"; };
680 };
681 
683  ASCString message;
684  int recipients;
685  public:
687  void readData ( tnstream& stream );
688  void writeData ( tnstream& stream );
689 
690  void execute( MapDisplayInterface* md );
691 
693  void setLocalizationString( const ASCString& s );
694 
695 
696  void setup();
697 
698  ASCString getName() const { return "Display Message (immediate text)"; };
699 
700 };
701 
703  MapCoordinate pos;
704  int vehicleTypeID;
705  public:
707 
708  void readData ( tnstream& stream );
709  void writeData ( tnstream& stream );
710 
711  void execute( MapDisplayInterface* md );
712  void setup();
713 
714  ASCString getName() const { return "Add Production Capability"; };
715 
716 };
717 
718 
720  int proposingPlayer;
721  int targetPlayer;
722  enum Proposal { Peace, War, SneakAttack } proposal;
723  public:
724  ChangeDiplomaticStatus(): EventAction( EventAction_ChangeDiplomaticStatus ), proposingPlayer(0), targetPlayer(0), proposal(Peace){};
725 
726  void readData ( tnstream& stream );
727  void writeData ( tnstream& stream );
728 
729  void execute( MapDisplayInterface* md );
730  void setup();
731 
732  ASCString getName() const { return "Change Diplomatic Status"; };
733 
734 };
735 
736 class SetViewSharing : public EventAction {
737  int viewingPlayer;
738  int providingPlayer;
739  bool enable;
740  public:
741  SetViewSharing(): EventAction( EventAction_SetViewSharing ), viewingPlayer(0), providingPlayer(0), enable(true){};
742 
743  void readData ( tnstream& stream );
744  void writeData ( tnstream& stream );
745 
746  void execute( MapDisplayInterface* md );
747  void setup();
748 
749  ASCString getName() const { return "Set view sharing"; };
750 
751 };
752 
753 
754 class AddResources : public EventAction {
755  MapCoordinate pos;
756  Resources res;
757  public:
759 
760  void readData ( tnstream& stream );
761  void writeData ( tnstream& stream );
762 
763  void execute( MapDisplayInterface* md );
764  void setup();
765 
766  ASCString getName() const { return "Add Resources to Building"; };
767 };
768 
769 class Reinforcements : public EventAction {
771  int objectNum;
772  friend class ReinforcementSelector;
773  enum Type { ReinfVehicle, ReinfBuilding };
774  public:
776 
777  void readData ( tnstream& stream );
778  void writeData ( tnstream& stream );
779 
780  void execute( MapDisplayInterface* md );
781  void setup();
782 
783  ASCString getName() const { return "Reinforcements"; };
784 
785 };
786 
787 
788 
789 // }; // namespace GameEvents
790 
791 #endif
void execute(MapDisplayInterface *md)
ASCString getTypeName() const
Definition: gameevents.cpp:457
ASCString getDetailledName() const
Definition: gameevents.cpp:433
WeatherChange(int weather_=-1)
Definition: gameevents.h:513
BuildingSeen(const MapCoordinate &position)
Definition: gameevents.h:296
void fieldOperator(const MapCoordinate &mc)
ASCString getDetailledName() const
Definition: gameevents.h:140
PositionTrigger(EventTriggerID id)
Definition: gameevents.h:242
void triggered(const Context &context)
Definition: gameevents.cpp:707
virtual State getState(int player)
Definition: gameevents.cpp:595
UnitLost(int unitID_)
Definition: gameevents.h:182
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:742
An in-memory storage of streamed data.
Definition: basestrm.h:172
void triggered(const Context &context)
Definition: gameevents.cpp:792
ASCString getDetailledName() const
Definition: gameevents.cpp:828
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:663
ChangeGameParameter(int ParameterNum, int ParameterValue)
Definition: gameevents.h:466
State getState(int player)
Definition: gameevents.h:127
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...
Definition: basestrm.cpp:363
virtual void readData(tnstream &stream)
Definition: gameevents.h:231
void writeData(tnstream &stream)
Definition: gameevents.h:560
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:491
void execute(MapDisplayInterface *md)
void setup()
Definition: gameevents.h:648
void readData(tnstream &stream)
virtual State getState(int player)
Definition: gameevents.cpp:390
ASCString getName() const
Definition: gameevents.h:565
ASCString getName() const
Definition: gameevents.h:497
void execute(MapDisplayInterface *md)
void readData(tnstream &stream)
ASCString getDetailledName() const
Definition: gameevents.cpp:126
virtual State getState(int player)
Definition: gameevents.cpp:799
EventAction_ID
Definition: gameevents.h:60
BuildingDestroyed(const MapCoordinate &position)
Definition: gameevents.h:286
void execute(MapDisplayInterface *md)
virtual State getState(int player)
Definition: gameevents.cpp:233
ASCString getTypeName() const
Definition: gameevents.h:297
NextMap(int mapID_)
Definition: gameevents.h:592
virtual void writeData(tnstream &stream)
Definition: gameevents.h:232
void execute(MapDisplayInterface *md)
Definition: gameevents.cpp:908
ASCString getDetailledName() const
Definition: gameevents.cpp:407
virtual int readInt(void)
Reads a 32 bit signed Integer. In the stream little-endian byte order is used and a translation is pe...
Definition: basestrm.cpp:284
void execute(MapDisplayInterface *md)
MapModificationEvent(EventActionID id)
Definition: gameevents.h:503
void readData(tnstream &stream)
void execute(MapDisplayInterface *md)
BuildingConquered(EventTriggerID id)
Definition: gameevents.h:259
void setEventID(int eventID_)
Definition: gameevents.h:310
ASCString getName() const
Definition: gameevents.h:585
GameMap * gamemap
ASCString getTypeName() const
Definition: gameevents.cpp:508
ASCString getDetailledName() const
Definition: gameevents.h:131
ASCString getName() const
Definition: gameevents.h:452
ASCString getName() const
Definition: gameevents.h:714
virtual State getState(int player)
Definition: gameevents.cpp:157
vector< Poly_gon > Polygons
Definition: gameevents.h:90
ASCString getTypeName() const
Definition: gameevents.cpp:605
virtual void readData(tnstream &stream)
Definition: gameevents.h:218
void readData(tnstream &stream)
Definition: gameevents.cpp:915
void readData(tnstream &stream)
Definition: gameevents.h:608
void writeData(tnstream &stream)
Definition: gameevents.cpp:989
void setLocalizationString(const ASCString &s)
ASCString getDetailledName() const
Definition: gameevents.cpp:761
void setup()
Definition: gameevents.cpp:900
void readMapModificationData(tnstream &stream)
ASCString getTypeName() const
Definition: gameevents.h:139
virtual State getState(int player)
Definition: gameevents.cpp:448
ASCString getTypeName() const
Definition: gameevents.cpp:756
void arm()
Definition: gameevents.cpp:380
void execute(MapDisplayInterface *md)
Definition: gameevents.h:426
void execute(MapDisplayInterface *md)
void execute(MapDisplayInterface *md)
void fieldOperator(const MapCoordinate &mc)
Definition: gameevents.cpp:723
SpecificUnitEntersPolygon(int unitID_=-1)
Definition: gameevents.h:361
ASCString getTypeName() const
Definition: gameevents.h:130
ASCString getDetailledName() const
Definition: gameevents.cpp:462
virtual State getState(int player)
Definition: gameevents.cpp:193
ASCString getDetailledName() const
Definition: gameevents.cpp:572
void readData(tnstream &stream)
operating with polygons on tje map
ASCString getDetailledName() const
Definition: gameevents.cpp:319
friend Event * readOldEvent(tnstream *stream, GameMap *gamemap, map< int, int > &eventTranslation, map< EventTriggered *, int > &eventTriggerEvents)
The interface for all kinds of IO stream.
ASCString getTypeName() const
Definition: gameevents.cpp:670
void writeData(tnstream &stream)
Definition: gameevents.h:645
void writeData(tnstream &stream)
void readData(tnstream &stream)
void writeData(tnstream &stream)
ASCString getName() const
Definition: gameevents.h:732
ASCString getName() const
Definition: gameevents.h:749
EventTrigger_ID
Definition: gameevents.h:40
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
ASCString getName() const
Definition: gameevents.cpp:356
void triggered()
Definition: gameevents.cpp:299
ASCString getTypeName() const
Definition: gameevents.h:276
void readData(tnstream &stream)
void fieldOperator(const MapCoordinate &mc)
void fieldOperator(const MapCoordinate &mc)
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:807
void readData(tnstream &stream)
Definition: gameevents.cpp:863
EventTriggered(int eventID_=-1)
Definition: gameevents.h:309
ASCString getName() const
Definition: gameevents.h:476
AddObject(int objectID_)
Definition: gameevents.h:545
virtual State getState(int player)
Definition: gameevents.cpp:477
ASCString getLocalizationString() const
void writeData(tnstream &stream)
virtual State getState(int player)
Definition: gameevents.cpp:713
void execute(MapDisplayInterface *md)
Definition: gameevents.cpp:874
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:71
void setup()
Definition: gameevents.cpp:368
void writeData(tnstream &stream)
void setup()
Definition: gameevents.h:235
void writeData(tnstream &stream)
ASCString getDetailledName() const
Definition: gameevents.cpp:513
void triggered()
Definition: gameevents.cpp:373
void readData(tnstream &stream)
Definition: gameevents.h:559
ASCString getDetailledName() const
Definition: gameevents.cpp:610
AddressingMode addressingMode
Definition: gameevents.h:101
void writeData(tnstream &stream)
Definition: gameevents.cpp:868
virtual void writeData(tnstream &stream)
Definition: gameevents.h:330
ASCString getTypeName() const
Definition: gameevents.cpp:314
ASCString getName() const
Definition: gameevents.h:636
virtual State getState(int player)
Definition: gameevents.cpp:325
ASCString getName() const
Definition: gameevents.h:429
ASCString getTypeName() const
Definition: gameevents.cpp:427
void execute(MapDisplayInterface *md)
ASCString getTypeName() const
Definition: gameevents.cpp:823
void setup()
Definition: gameevents.h:612
Coordinate on the twodimensional map.
Definition: typen.h:202
ASCString getName() const
Definition: gameevents.h:698
ASCString getDetailledName() const
Definition: gameevents.h:298
virtual void writeData(tnstream &stream)
Definition: gameevents.h:347
void writeData(tnstream &stream)
Definition: gameevents.cpp:922
void execute(MapDisplayInterface *md)
TriggerNothing(EventTriggerID id)
Definition: gameevents.h:119
void readData(tnstream &stream)
virtual State getState(int player)
Definition: gameevents.cpp:248
MapCoordinate pos
Definition: gameevents.h:241
void setup()
ASCString getName() const
Definition: gameevents.h:663
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:76
void writeData(tnstream &stream)
Definition: gameevents.cpp:893
void setup()
void setup()
Definition: gameevents.cpp:114
ASCString getDetailledName() const
Definition: gameevents.h:265
FieldAddressing(GameMap *&gamemap)
Definition: gameevents.h:98
ASCString getName() const
Definition: gameevents.h:679
ASCString getName() const
Definition: gameevents.h:766
BuildingLost(const MapCoordinate &position)
Definition: gameevents.h:275
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:485
void readData(tnstream &stream)
Definition: gameevents.cpp:983
virtual ~FieldAddressing()
Definition: gameevents.h:95
MapChange(int terrainID_=-1)
Definition: gameevents.h:529
void setPolygon(const Poly_gon &poly_gon)
BuildingPositionTrigger(EventTriggerID id)
Definition: gameevents.h:250
ASCString getTypeName() const
Definition: gameevents.cpp:333
void writeData(tnstream &stream)
void arm()
Definition: gameevents.cpp:92
void readData(tnstream &stream)
void execute(MapDisplayInterface *md)
virtual State getState(int player)
Definition: gameevents.cpp:83
void fieldOperator(const MapCoordinate &mc)
Definition: gameevents.cpp:640
virtual State getState(int player)
Definition: gameevents.cpp:630
void writeData(tnstream &stream)
void readData(tnstream &stream)
Definition: gameevents.h:644
ASCString getName() const
Definition: gameevents.h:551
virtual State getState(int player)
Definition: gameevents.cpp:306
ASCString getName() const
Definition: gameevents.cpp:138
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:107
ASCString getDetailledName() const
Definition: gameevents.h:288
ASCString getName() const
Definition: gameevents.h:650
void writeData(tnstream &stream)
void readData(tnstream &stream)
void writeData(tnstream &stream)
State getState(int player)
Definition: gameevents.h:136
BuildingConquered(const MapCoordinate &position)
Definition: gameevents.h:263
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:343
ChangeBuildingDamage(const MapCoordinate &pos, int dam)
Definition: gameevents.h:576
ASCString getName() const
Definition: gameevents.h:783
UnitConquered(int unitID_)
Definition: gameevents.h:193
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:749
void readData(tnstream &stream)
UnitTrigger(EventTriggerID id)
Definition: gameevents.h:167
void writeData(tnstream &stream)
ASCString getDetailledName() const
Definition: gameevents.cpp:676
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:220
ASCString getTypeName() const
Definition: gameevents.h:264
int EventActionID
DisplayEllipse(int x1_, int y1_, int x2_, int y2_, bool alignRight_, bool alignBottom_)
Definition: gameevents.h:626
vector< MapCoordinate > Fields
Definition: gameevents.h:89
ASCString getTypeName() const
Definition: gameevents.cpp:577
void readData(tnstream &stream)
TurnPassed(int turn_, int move_)
Definition: gameevents.h:152
void readData(tnstream &stream)
void setup()
void execute(MapDisplayInterface *md)
ASCString getName() const
Definition: gameevents.h:600
Direction
Definition: weatherarea.h:84
AnyUnitEntersPolygon(int player_=0)
Definition: gameevents.h:382
GameMap * actmap
Definition: spfst.cpp:64
Interface to the event handling of ASC.
ASCString getTypeName() const
Definition: gameevents.cpp:121
void execute(MapDisplayInterface *md)
Definition: gameevents.cpp:975
virtual void readData(tnstream &stream)
Definition: gameevents.h:346
void writeData(tnstream &stream)
Definition: gameevents.h:609
virtual State getState(int player)
Definition: gameevents.cpp:416
GameMap * gamemap
virtual State getState(int player)
Definition: gameevents.cpp:561
Polygons polygons
Definition: gameevents.h:103
void writeData(tnstream &stream)
void writeData(tnstream &stream)
void writeData(tnstream &stream)
Resources are basically the currency of ASC.
Definition: typen.h:97
ASCString getDetailledName() const
Definition: gameevents.cpp:338
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:350
void setField(const MapCoordinate &pos)
virtual void readData(tnstream &stream)
Definition: gameevents.h:329
WindChange(int Speed, int Direction)
Definition: gameevents.h:442
UnitDestroyed(int unitID_)
Definition: gameevents.h:204
virtual void writeData(tnstream &stream)
Definition: gameevents.h:219
void writeMapModificationData(tnstream &stream)
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:227
void readData(tnstream &stream)
Definition: gameevents.cpp:886
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:100
ASCString getTypeName() const
Definition: gameevents.h:287
void setpointabs(int x, int y)
ASCString getName() const
Definition: gameevents.h:614
virtual void fieldOperator(const MapCoordinate &mc)=0
virtual void writeData(tnstream &stream)
Definition: gameevents.cpp:815
ASCString getDetailledName() const
Definition: gameevents.h:277
ASCString getName() const
Definition: gameevents.h:520
ASCString getTypeName() const
Definition: gameevents.cpp:401
void readData(tnstream &stream)
void execute(MapDisplayInterface *md)
DisplayMessage(int messageNumber)
Definition: gameevents.h:488
void fieldOperator(const MapCoordinate &mc)
void readData(tnstream &stream)
void execute(MapDisplayInterface *md)
void writeData(tnstream &stream)
virtual void readData(tnstream &stream)
Definition: gameevents.cpp:656
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182
int EventTriggerID
ASCString getName() const
Definition: gameevents.h:535