aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/gamestate.h
blob: 383b062788f630a057d3b2159327b994bdc91ac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * Additional copyright for this file:
 * Copyright (C) 1995-1997 Presto Studios, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

#ifndef PEGASUS_GAMESTATE_H
#define PEGASUS_GAMESTATE_H

#include "common/singleton.h"
#include "common/util.h"

#include "pegasus/types.h"
#include "pegasus/util.h"
#include "pegasus/items/item.h"

namespace Common {
	class Error;
	class ReadStream;
	class WriteStream;
}

namespace Pegasus {

// The only things saved in here are things which get written out to a saved game file...

enum {
	kGlobalWalkthroughFlag,
	kGlobalShieldOnFlag,
	kGlobalEasterEggFlag,
	kGlobalBeenToWSCFlag,
	kGlobalBeenToMarsFlag,
	kGlobalBeenToNoradFlag,
	kGlobalWSCFinishedFlag,
	kGlobalMarsFinishedFlag,
	kGlobalNoradFinishedFlag,
	kNumGlobalFlags
};

enum {
	kScoringSawINNFlag,
	kScoringTookShowerFlag,
	kScoringFixedHairFlag,
	kScoringGotKeyCardFlag,
	kScoringReadPaperFlag,
	kScoringLookThroughTelescopeFlag,
	kScoringSawCaldoriaKioskFlag,
	kScoringGoToTSAFlag,
	kScoringEnterTSAFlag,
	kScoringSawBust1Flag,
	kScoringSawBust2Flag,
	kScoringSawBust3Flag,
	kScoringSawBust4Flag,
	kScoringSawBust5Flag,
	kScoringSawBust6Flag,
	kScoringSawTheoryFlag,
	kScoringSawBackgroundFlag,
	kScoringSawProcedureFlag,
	kScoringGotJourneymanKeyFlag,
	kScoringGotPegasusBiochipFlag,
	kScoringGotBiosuitFlag,
	kScoringGoToPrehistoricFlag,
	kScoringPutLogInReaderFlag,
	kScoringSawCaldoriaNormalFlag,
	kScoringSawCaldoriaAlteredFlag,
	kScoringSawNoradNormalFlag,
	kScoringSawNoradAlteredFlag,
	kScoringSawMarsNormalFlag,
	kScoringSawMarsAlteredFlag,
	kScoringSawWSCNormalFlag,
	kScoringSawWSCAlteredFlag,
	kScoringWentToReadyRoom2Flag,
	kScoringWentAfterSinclairFlag,
	kScoringUsedCardBombFlag,
	kScoringShieldedCardBombFlag,
	kScoringStunnedSinclairFlag,
	kScoringDisarmedNukeFlag,

	kScoringThrewBreakerFlag,
	kScoringExtendedBridgeFlag,
	kScoringGotHistoricalLogFlag,
	kScoringFinishedPrehistoricFlag,

	kScoringThrownByRobotFlag,
	kScoringGotMarsCardFlag,
	kScoringSawMarsKioskFlag,
	kScoringSawTransportMapFlag,
	kScoringGotCrowBarFlag,
	kScoringTurnedOnTransportFlag,
	kScoringGotOxygenMaskFlag,
	kScoringAvoidedRobotFlag,
	kScoringActivatedPlatformFlag,
	kScoringUsedLiquidNitrogenFlag,
	kScoringUsedCrowBarFlag,
	kScoringFoundCardBombFlag,
	kScoringDisarmedCardBombFlag,
	kScoringGotCardBombFlag,
	kScoringThreadedMazeFlag,
	kScoringThreadedGearRoomFlag,
	kScoringEnteredShuttleFlag,
	kScoringEnteredLaunchTubeFlag,
	kScoringStoppedRobotsShuttleFlag,
	kScoringGotMarsOpMemChipFlag,
	kScoringFinishedMarsFlag,

	kScoringSawSecurityMonitorFlag,
	kScoringFilledOxygenCanisterFlag,
	kScoringFilledArgonCanisterFlag,
	kScoringSawUnconsciousOperatorFlag,
	kScoringWentThroughPressureDoorFlag,
	kScoringPreppedSubFlag,
	kScoringEnteredSubFlag,
	kScoringExitedSubFlag,
	kScoringSawRobotAt54NorthFlag,
	kScoringPlayedWithClawFlag,
	kScoringUsedRetinalChipFlag,
	kScoringFinishedGlobeGameFlag,
	kScoringStoppedNoradRobotFlag,
	kScoringGotNoradOpMemChipFlag,
	kScoringFinishedNoradFlag,

	kScoringRemovedDartFlag,
	kScoringAnalyzedDartFlag,
	kScoringBuiltAntidoteFlag,
	kScoringGotSinclairKeyFlag,
	kScoringGotArgonCanisterFlag,
	kScoringGotNitrogenCanisterFlag,
	kScoringPlayedWithMessagesFlag,
	kScoringSawMorphExperimentFlag,
	kScoringEnteredSinclairOfficeFlag,
	kScoringSawBrochureFlag,
	kScoringSawSinclairEntry1Flag,
	kScoringSawSinclairEntry2Flag,
	kScoringSawSinclairEntry3Flag,
	kScoringSawWSCDirectoryFlag,
	kScoringUsedCrowBarInWSCFlag,
	kScoringFinishedPlasmaDodgeFlag,
	kScoringOpenedCatwalkFlag,
	kScoringStoppedWSCRobotFlag,
	kScoringGotWSCOpMemChipFlag,
	kScoringFinishedWSCFlag,

	kScoringMarsGandhiFlag,
	kScoringNoradGandhiFlag,
	kScoringWSCGandhiFlag,

	kNumScoringFlags
};

enum {
	kCaldoriaSeenPullbackFlag,
	kCaldoriaMadeOJFlag,
	kCaldoriaWokenUpFlag,
	kCaldoriaDidRecalibrationFlag,
	kCaldoriaSeenSinclairInElevatorFlag,
	kCaldoriaINNAnnouncingFlag,
	kCaldoriaSeenINNFlag,
	kCaldoriaSeenMessagesFlag,
	kCaldoriaSinclairShotFlag,
	kCaldoriaBombDisarmedFlag,
	kCaldoriaRoofDoorOpenFlag,
	kCaldoriaDoneHygieneFlag,
	kCaldoriaSawVoiceAnalysisFlag,
	kCaldoriaDoorBombedFlag,
	kCaldoriaGunAimedFlag,
	kNumCaldoriaFlags
};

enum {
	kCaldoriaNoFuseRunning,
	kCaldoriaDoorBombFuseRunning,
	kCaldoriaSinclairFuseRunning
};

enum {
	kTSAIDedAtDoorFlag,
	kTSA0BZoomedInFlag,
	kTSAFrontDoorUnlockedOutsideFlag,
	kTSAFrontDoorUnlockedInsideFlag,
	kTSASeenRobotGreetingFlag,
	kTSASeenTheoryFlag,
	kTSASeenBackgroundFlag,
	kTSASeenProcedureFlag,
	kTSASeenAgent3AtDoorFlag,
	kTSACommandCenterLockedFlag,
	kTSASeenCaldoriaNormalFlag,
	kTSASeenCaldoriaAlteredFlag,
	kTSASeenNoradNormalFlag,
	kTSASeenNoradAlteredFlag,
	kTSASeenMarsNormalFlag,
	kTSASeenMarsAlteredFlag,
	kTSASeenWSCNormalFlag,
	kTSASeenWSCAlteredFlag,
	kTSABiosuitOnFlag,
	kNumTSAFlags
};

enum {
	kPrehistoricTriedToExtendBridgeFlag,
	kPrehistoricSeenTimeStreamFlag,
	kPrehistoricSeenFlyer1Flag,
	kPrehistoricSeenFlyer2Flag,
	kPrehistoricSeenBridgeZoomFlag,
	kPrehistoricBreakerThrownFlag,
	kNumPrehistoricFlags
};

enum {
	kNoradSeenTimeStreamFlag,
	kNoradGassedFlag,
	kNoradFillingStationOnFlag,
	kNoradN22MessagePlayedFlag,
	kNoradArrivedFromSubFlag,
	kNoradWaitingForLaserFlag,
	kNoradRetScanGoodFlag,
	kNoradPlayedGlobeGameFlag,
	kNoradBeatRobotWithClawFlag,
	kNoradBeatRobotWithDoorFlag,
	kNumNoradFlags
};

enum {
	kMarsSeenTimeStreamFlag,
	kMarsHeardUpperPodMessageFlag,
	kMarsRobotThrownPlayerFlag,
	kMarsHeardCheckInMessageFlag,
	kMarsPodAtUpperPlatformFlag,
	kMarsSeenThermalScanFlag,
	kMarsArrivedBelowFlag,
	kMarsSeenRobotAtReactorFlag,
	kMarsAvoidedReactorRobotFlag,
	kMarsInAirlockFlag,
	kMarsAirlockOpenFlag,
	kMarsMaskOnFillerFlag,
	kMarsLockFrozenFlag,
	kMarsLockBrokenFlag,
	kMarsMazeDoorPair1Flag,
	kMarsMazeDoorPair2Flag,
	kMarsMazeDoorPair3Flag,
	kMarsSawRobotLeaveFlag,
	kMarsSecurityDownFlag,
	kMarsHitRobotWithCannonFlag,
	kMarsReadyForShuttleTransportFlag,
	kMarsFinishedCanyonChaseFlag,
	kMarsThreadedMazeFlag,
	kNumMarsFlags
};

enum {
	kWSCSeenTimeStreamFlag,
	kWSCPoisonedFlag,
	kWSCAnsweredAboutDartFlag,
	kWSCRemovedDartFlag,
	kWSCAnalyzerOnFlag,
	kWSCDartInAnalyzerFlag,
	kWSCAnalyzedDartFlag,
	kWSCSawMorphFlag,
	kWSCDesignedAntidoteFlag,
	kWSCPickedUpAntidoteFlag,
	kWSCOfficeMessagesOpenFlag,
	kWSCSeenNerdFlag,
	kWSCHeardPage1Flag,
	kWSCHeardPage2Flag,
	kWSCHeardCheckInFlag,
	kWSCDidPlasmaDodgeFlag,
	kWSCSeenSinclairLectureFlag,
	kWSCBeenAtWSC93Flag,
	kWSCCatwalkDarkFlag,
	kWSCRobotDeadFlag,
	kWSCRobotGoneFlag,
	kNumWSCFlags
};

class GameStateManager : public Common::Singleton<GameStateManager> {
public:
	GameStateManager() { resetGameState(); }

	// Base game state
	Common::Error writeGameState(Common::WriteStream *stream);
	Common::Error readGameState(Common::ReadStream *stream);

	void resetGameState();

	void getCurrentLocation(NeighborhoodID &neighborhood, RoomID &room, DirectionConstant &direction);
	void setCurrentLocation(const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction);

	NeighborhoodID getCurrentNeighborhood();
	void setCurrentNeighborhood(const NeighborhoodID neighborhood);
	RoomID getCurrentRoom();
	void setCurrentRoom(const RoomID room);
	DirectionConstant getCurrentDirection();
	void setCurrentDirection(const DirectionConstant direction);

	RoomViewID getCurrentRoomAndView();

	void getNextLocation(NeighborhoodID &neighborhood, RoomID &room, DirectionConstant &direction);
	void setNextLocation(const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction);

	NeighborhoodID getNextNeighborhood();
	void setNextNeighborhood(const NeighborhoodID neighborhood);
	RoomID getNextRoom();
	void setNextRoom(const RoomID room);
	DirectionConstant getNextDirection();
	void setNextDirection(const DirectionConstant direction);

	void getLastLocation(NeighborhoodID &neighborhood, RoomID &room, DirectionConstant &direction);
	void setLastLocation(const NeighborhoodID neighborhood, const RoomID room, const DirectionConstant direction);

	NeighborhoodID getLastNeighborhood();
	void setLastNeighborhood(const NeighborhoodID neighborhood);
	RoomID getLastRoom();
	void setLastRoom(const RoomID room);
	DirectionConstant getLastDirection();
	void setLastDirection(const DirectionConstant direction);

	RoomViewID getLastRoomAndView();

	void getOpenDoorLocation(RoomID &room, DirectionConstant &direction);
	void setOpenDoorLocation(const RoomID room, const DirectionConstant direction);
	RoomID getOpenDoorRoom();
	void setOpenDoorRoom(const RoomID room);
	DirectionConstant getOpenDoorDirection();
	void setOpenDoorDirection(const DirectionConstant direction);

	RoomViewID getDoorOpenRoomAndView();

	bool isCurrentDoorOpen();

	// Pegasus Prime

	// Scoring...
	// Scoring "Set" functions.
	// Caldoria/TSA scoring
	void setScoringSawINN(const bool = true);
	void setScoringTookShower(const bool = true);
	void setScoringFixedHair(const bool = true);
	void setScoringGotKeyCard(const bool = true);
	void setScoringReadPaper(const bool = true);
	void setScoringLookThroughTelescope(const bool = true);
	void setScoringSawCaldoriaKiosk(const bool = true);
	void setScoringGoToTSA(const bool = true);
	void setScoringEnterTSA(const bool = true);
	void setScoringSawBust1(const bool = true);
	void setScoringSawBust2(const bool = true);
	void setScoringSawBust3(const bool = true);
	void setScoringSawBust4(const bool = true);
	void setScoringSawBust5(const bool = true);
	void setScoringSawBust6(const bool = true);
	void setScoringSawTheory(const bool = true);
	void setScoringSawBackground(const bool = true);
	void setScoringSawProcedure(const bool = true);
	void setScoringGotJourneymanKey(const bool = true);
	void setScoringGotPegasusBiochip(const bool = true);
	void setScoringGotBiosuit(const bool = true);
	void setScoringGoToPrehistoric(const bool = true);
	void setScoringPutLogInReader(const bool = true);
	void setScoringSawCaldoriaNormal(const bool = true);
	void setScoringSawCaldoriaAltered(const bool = true);
	void setScoringSawNoradNormal(const bool = true);
	void setScoringSawNoradAltered(const bool = true);
	void setScoringSawMarsNormal(const bool = true);
	void setScoringSawMarsAltered(const bool = true);
	void setScoringSawWSCNormal(const bool = true);
	void setScoringSawWSCAltered(const bool = true);
	void setScoringWentToReadyRoom2(const bool = true);
	void setScoringWentAfterSinclair(const bool = true);
	void setScoringUsedCardBomb(const bool = true);
	void setScoringShieldedCardBomb(const bool = true);
	void setScoringStunnedSinclair(const bool = true);
	void setScoringDisarmedNuke(const bool = true);

	// Prehistoric scoring
	void setScoringThrewBreaker(const bool = true);
	void setScoringExtendedBridge(const bool = true);
	void setScoringGotHistoricalLog(const bool = true);
	void setScoringFinishedPrehistoric(const bool = true);

	// Mars scoring
	void setScoringThrownByRobot(const bool = true);
	void setScoringGotMarsCard(const bool = true);
	void setScoringSawMarsKiosk(const bool = true);
	void setScoringSawTransportMap(const bool = true);
	void setScoringGotCrowBar(const bool = true);
	void setScoringTurnedOnTransport(const bool = true);
	void setScoringGotOxygenMask(const bool = true);
	void setScoringAvoidedRobot(const bool = true);
	void setScoringActivatedPlatform(const bool = true);
	void setScoringUsedLiquidNitrogen(const bool = true);
	void setScoringUsedCrowBar(const bool = true);
	void setScoringFoundCardBomb(const bool = true);
	void setScoringDisarmedCardBomb(const bool = true);
	void setScoringGotCardBomb(const bool = true);
	void setScoringThreadedMaze(const bool = true);
	void setScoringThreadedGearRoom(const bool = true);
	void setScoringEnteredShuttle(const bool = true);
	void setScoringEnteredLaunchTube(const bool = true);
	void setScoringStoppedRobotsShuttle(const bool = true);
	void setScoringGotMarsOpMemChip(const bool = true);
	void setScoringFinishedMars(const bool = true);

	// Norad scoring
	void setScoringSawSecurityMonitor(const bool = true);
	void setScoringFilledOxygenCanister(const bool = true);
	void setScoringFilledArgonCanister(const bool = true);
	void setScoringSawUnconsciousOperator(const bool = true);
	void setScoringWentThroughPressureDoor(const bool = true);
	void setScoringPreppedSub(const bool = true);
	void setScoringEnteredSub(const bool = true);
	void setScoringExitedSub(const bool = true);
	void setScoringSawRobotAt54North(const bool = true);
	void setScoringPlayedWithClaw(const bool = true);
	void setScoringUsedRetinalChip(const bool = true);
	void setScoringFinishedGlobeGame(const bool = true);
	void setScoringStoppedNoradRobot(const bool = true);
	void setScoringGotNoradOpMemChip(const bool = true);
	void setScoringFinishedNorad(const bool = true);

	// WSC scoring
	void setScoringRemovedDart(const bool = true);
	void setScoringAnalyzedDart(const bool = true);
	void setScoringBuiltAntidote(const bool = true);
	void setScoringGotSinclairKey(const bool = true);
	void setScoringGotArgonCanister(const bool = true);
	void setScoringGotNitrogenCanister(const bool = true);
	void setScoringPlayedWithMessages(const bool = true);
	void setScoringSawMorphExperiment(const bool = true);
	void setScoringEnteredSinclairOffice(const bool = true);
	void setScoringSawBrochure(const bool = true);
	void setScoringSawSinclairEntry1(const bool = true);
	void setScoringSawSinclairEntry2(const bool = true);
	void setScoringSawSinclairEntry3(const bool = true);
	void setScoringSawWSCDirectory(const bool = true);
	void setScoringUsedCrowBarInWSC(const bool = true);
	void setScoringFinishedPlasmaDodge(const bool = true);
	void setScoringOpenedCatwalk(const bool = true);
	void setScoringStoppedWSCRobot(const bool = true);
	void setScoringGotWSCOpMemChip(const bool = true);
	void setScoringFinishedWSC(const bool = true);

	// Gandhi scoring
	void setScoringMarsGandhi(const bool = true);
	void setScoringNoradGandhi(const bool = true);
	void setScoringWSCGandhi(const bool = true);

	// Scoring "Get" functions.
	bool getScoringSawINN();
	bool getScoringTookShower();
	bool getScoringFixedHair();
	bool getScoringGotKeyCard();
	bool getScoringReadPaper();
	bool getScoringLookThroughTelescope();
	bool getScoringSawCaldoriaKiosk();
	bool getScoringGoToTSA();
	bool getScoringEnterTSA();
	bool getScoringSawBust1();
	bool getScoringSawBust2();
	bool getScoringSawBust3();
	bool getScoringSawBust4();
	bool getScoringSawBust5();
	bool getScoringSawBust6();
	bool getScoringSawTheory();
	bool getScoringSawBackground();
	bool getScoringSawProcedure();
	bool getScoringGotJourneymanKey();
	bool getScoringGotPegasusBiochip();
	bool getScoringGotBiosuit();
	bool getScoringGoToPrehistoric();
	bool getScoringPutLogInReader();
	bool getScoringSawCaldoriaNormal();
	bool getScoringSawCaldoriaAltered();
	bool getScoringSawNoradNormal();
	bool getScoringSawNoradAltered();
	bool getScoringSawMarsNormal();
	bool getScoringSawMarsAltered();
	bool getScoringSawWSCNormal();
	bool getScoringSawWSCAltered();
	bool getScoringWentToReadyRoom2();
	bool getScoringWentAfterSinclair();
	bool getScoringUsedCardBomb();
	bool getScoringShieldedCardBomb();
	bool getScoringStunnedSinclair();
	bool getScoringDisarmedNuke();
	bool getScoringThrewBreaker();
	bool getScoringExtendedBridge();
	bool getScoringGotHistoricalLog();
	bool getScoringFinishedPrehistoric();
	bool getScoringThrownByRobot();
	bool getScoringGotMarsCard();
	bool getScoringSawMarsKiosk();
	bool getScoringSawTransportMap();
	bool getScoringGotCrowBar();
	bool getScoringTurnedOnTransport();
	bool getScoringGotOxygenMask();
	bool getScoringAvoidedRobot();
	bool getScoringActivatedPlatform();
	bool getScoringUsedLiquidNitrogen();
	bool getScoringUsedCrowBar();
	bool getScoringFoundCardBomb();
	bool getScoringDisarmedCardBomb();
	bool getScoringGotCardBomb();
	bool getScoringThreadedMaze();
	bool getScoringThreadedGearRoom();
	bool getScoringEnteredShuttle();
	bool getScoringEnteredLaunchTube();
	bool getScoringStoppedRobotsShuttle();
	bool getScoringGotMarsOpMemChip();
	bool getScoringFinishedMars();
	bool getScoringSawSecurityMonitor();
	bool getScoringFilledOxygenCanister();
	bool getScoringFilledArgonCanister();
	bool getScoringSawUnconsciousOperator();
	bool getScoringWentThroughPressureDoor();
	bool getScoringPreppedSub();
	bool getScoringEnteredSub();
	bool getScoringExitedSub();
	bool getScoringSawRobotAt54North();
	bool getScoringPlayedWithClaw();
	bool getScoringUsedRetinalChip();
	bool getScoringFinishedGlobeGame();
	bool getScoringStoppedNoradRobot();
	bool getScoringGotNoradOpMemChip();
	bool getScoringFinishedNorad();
	bool getScoringRemovedDart();
	bool getScoringAnalyzedDart();
	bool getScoringBuiltAntidote();
	bool getScoringGotSinclairKey();
	bool getScoringGotArgonCanister();
	bool getScoringGotNitrogenCanister();
	bool getScoringPlayedWithMessages();
	bool getScoringSawMorphExperiment();
	bool getScoringEnteredSinclairOffice();
	bool getScoringSawBrochure();
	bool getScoringSawSinclairEntry1();
	bool getScoringSawSinclairEntry2();
	bool getScoringSawSinclairEntry3();
	bool getScoringSawWSCDirectory();
	bool getScoringUsedCrowBarInWSC();
	bool getScoringFinishedPlasmaDodge();
	bool getScoringOpenedCatwalk();
	bool getScoringStoppedWSCRobot();
	bool getScoringGotWSCOpMemChip();
	bool getScoringFinishedWSC();
	bool getScoringMarsGandhi();
	bool getScoringNoradGandhi();
	bool getScoringWSCGandhi();

	GameScoreType getCaldoriaTSAScore();
	GameScoreType getPrehistoricScore();
	GameScoreType getMarsScore();
	GameScoreType getNoradScore();
	GameScoreType getWSCScore();
	GameScoreType getGandhiScore();
	GameScoreType getTotalScore();

	void writeCaldoriaState(Common::WriteStream *stream);
	void readCaldoriaState(Common::ReadStream *stream);
	void resetCaldoriaState();

	void writeTSAState(Common::WriteStream *stream);
	void readTSAState(Common::ReadStream *stream);
	void resetTSAState();

	void writePrehistoricState(Common::WriteStream *stream);
	void readPrehistoricState(Common::ReadStream *stream);
	void resetPrehistoricState();

	void writeNoradState(Common::WriteStream *stream);
	void readNoradState(Common::ReadStream *stream);
	void resetNoradState();

	void writeMarsState(Common::WriteStream *stream);
	void readMarsState(Common::ReadStream *stream);
	void resetMarsState();

	void writeWSCState(Common::WriteStream *stream);
	void readWSCState(Common::ReadStream *stream);
	void resetWSCState();

	// Globals.
	void setWalkthroughMode(bool);
	bool getWalkthroughMode();
	void setShieldOn(bool);
	bool getShieldOn();
	void setEasterEgg(bool);
	bool getEasterEgg();
	void setBeenToWSC(bool value);
	bool getBeenToWSC();
	void setBeenToMars(bool value);
	bool getBeenToMars();
	void setBeenToNorad(bool value);
	bool getBeenToNorad();
	void setWSCFinished(bool);
	bool getWSCFinished();
	void setMarsFinished(bool);
	bool getMarsFinished();
	void setNoradFinished(bool);
	bool getNoradFinished();
	bool allTimeZonesFinished();
	void setTakenItemID(ItemID, bool);
	bool isTakenItemID(ItemID);
	void setTakenItem(Item *, bool);
	bool isTakenItem(Item *);

	// Caldoria
	void setCaldoriaFuseTimeLimit(const TimeValue);
	TimeValue getCaldoriaFuseTimeLimit();
	void setCaldoriaSeenPullback(bool);
	bool getCaldoriaSeenPullback();
	void setCaldoriaMadeOJ(bool);
	bool getCaldoriaMadeOJ();
	void setCaldoriaWokenUp(bool);
	bool getCaldoriaWokenUp();
	void setCaldoriaDidRecalibration(bool);
	bool getCaldoriaDidRecalibration();
	void setCaldoriaSeenSinclairInElevator(bool);
	bool getCaldoriaSeenSinclairInElevator();
	void setCaldoriaINNAnnouncing(bool);
	bool getCaldoriaINNAnnouncing();
	void setCaldoriaSeenINN(bool);
	bool getCaldoriaSeenINN();
	void setCaldoriaSeenMessages(bool);
	bool getCaldoriaSeenMessages();
	void setCaldoriaSinclairShot(bool);
	bool getCaldoriaSinclairShot();
	void setCaldoriaBombDisarmed(bool);
	bool getCaldoriaBombDisarmed();
	void setCaldoriaRoofDoorOpen(bool);
	bool getCaldoriaRoofDoorOpen();
	void setCaldoriaDoneHygiene(bool);
	bool getCaldoriaDoneHygiene();
	void setCaldoriaSawVoiceAnalysis(bool);
	bool getCaldoriaSawVoiceAnalysis();
	void setCaldoriaDoorBombed(bool);
	bool getCaldoriaDoorBombed();
	void setCaldoriaGunAimed(bool);
	bool getCaldoriaGunAimed();

	// TSA
	void setRipTimerTime(TimeValue);
	TimeValue getRipTimerTime();
	void setTSAFuseTimeLimit(TimeValue);
	TimeValue getTSAFuseTimeLimit();
	void setT0BMonitorMode(byte);
	byte getT0BMonitorMode();
	void setTSAState(byte);
	byte getTSAState();
	void setT0BMonitorStart(TimeValue);
	TimeValue getT0BMonitorStart();
	void setTSAIDedAtDoor(bool);
	bool getTSAIDedAtDoor();
	void setTSA0BZoomedIn(bool);
	bool getTSA0BZoomedIn();
	void setTSAFrontDoorUnlockedOutside(bool);
	bool getTSAFrontDoorUnlockedOutside();
	void setTSAFrontDoorUnlockedInside(bool);
	bool getTSAFrontDoorUnlockedInside();
	void setTSASeenRobotGreeting(bool);
	bool getTSASeenRobotGreeting();
	void setTSASeenTheory(bool);
	bool getTSASeenTheory();
	void setTSASeenBackground(bool);
	bool getTSASeenBackground();
	void setTSASeenProcedure(bool);
	bool getTSASeenProcedure();
	void setTSASeenAgent3AtDoor(bool);
	bool getTSASeenAgent3AtDoor();
	void setTSACommandCenterLocked(bool);
	bool getTSACommandCenterLocked();
	void setTSASeenCaldoriaNormal(bool);
	bool getTSASeenCaldoriaNormal();
	void setTSASeenCaldoriaAltered(bool);
	bool getTSASeenCaldoriaAltered();
	void setTSASeenNoradNormal(bool);
	bool getTSASeenNoradNormal();
	void setTSASeenNoradAltered(bool);
	bool getTSASeenNoradAltered();
	void setTSASeenMarsNormal(bool);
	bool getTSASeenMarsNormal();
	void setTSASeenMarsAltered(bool);
	bool getTSASeenMarsAltered();
	void setTSASeenWSCNormal(bool);
	bool getTSASeenWSCNormal();
	void setTSASeenWSCAltered(bool);
	bool getTSASeenWSCAltered();
	void setTSABiosuitOn(bool);
	bool getTSABiosuitOn();

	// Prehistoric
	void setPrehistoricTriedToExtendBridge(bool);
	bool getPrehistoricTriedToExtendBridge();
	void setPrehistoricSeenTimeStream(bool);
	bool getPrehistoricSeenTimeStream();
	void setPrehistoricSeenFlyer1(bool);
	bool getPrehistoricSeenFlyer1();
	void setPrehistoricSeenFlyer2(bool);
	bool getPrehistoricSeenFlyer2();
	void setPrehistoricSeenBridgeZoom(bool);
	bool getPrehistoricSeenBridgeZoom();
	void setPrehistoricBreakerThrown(bool);
	bool getPrehistoricBreakerThrown();

	// Norad
	void setNoradSeenTimeStream(bool);
	bool getNoradSeenTimeStream();
	void setNoradGassed(bool);
	bool getNoradGassed();
	void setNoradFillingStationOn(bool);
	bool getNoradFillingStationOn();
	void setNoradN22MessagePlayed(bool);
	bool getNoradN22MessagePlayed();
	void setNoradPlayedGlobeGame(bool);
	bool getNoradPlayedGlobeGame();
	void setNoradBeatRobotWithClaw(bool);
	bool getNoradBeatRobotWithClaw();
	void setNoradBeatRobotWithDoor(bool);
	bool getNoradBeatRobotWithDoor();
	void setNoradRetScanGood(bool);
	bool getNoradRetScanGood();
	void setNoradWaitingForLaser(bool);
	bool getNoradWaitingForLaser();
	void setNoradSubRoomPressure(uint16);
	uint16 getNoradSubRoomPressure();
	void setNoradSubPrepState(NoradSubPrepState);
	NoradSubPrepState getNoradSubPrepState();
	void setNoradArrivedFromSub(bool);
	bool getNoradArrivedFromSub();

	// Mars
	void setMarsSeenTimeStream(bool);
	bool getMarsSeenTimeStream();
	void setMarsHeardUpperPodMessage(bool);
	bool getMarsHeardUpperPodMessage();
	void setMarsRobotThrownPlayer(bool);
	bool getMarsRobotThrownPlayer();
	void setMarsHeardCheckInMessage(bool);
	bool getMarsHeardCheckInMessage();
	void setMarsPodAtUpperPlatform(bool);
	bool getMarsPodAtUpperPlatform();
	void setMarsSeenThermalScan(bool);
	bool getMarsSeenThermalScan();
	void setMarsArrivedBelow(bool);
	bool getMarsArrivedBelow();
	void setMarsSeenRobotAtReactor(bool);
	bool getMarsSeenRobotAtReactor();
	void setMarsAvoidedReactorRobot(bool);
	bool getMarsAvoidedReactorRobot();
	void setMarsInAirlock(bool);
	bool getMarsInAirlock();
	void setMarsAirlockOpen(bool);
	bool getMarsAirlockOpen();
	void setMarsMaskOnFiller(bool);
	bool getMarsMaskOnFiller();
	void setMarsLockFrozen(bool);
	bool getMarsLockFrozen();
	void setMarsLockBroken(bool);
	bool getMarsLockBroken();
	void setMarsMazeDoorPair1(bool);
	bool getMarsMazeDoorPair1();
	void setMarsMazeDoorPair2(bool);
	bool getMarsMazeDoorPair2();
	void setMarsMazeDoorPair3(bool);
	bool getMarsMazeDoorPair3();
	void setMarsSawRobotLeave(bool);
	bool getMarsSawRobotLeave();
	void setMarsSecurityDown(bool);
	bool getMarsSecurityDown();
	void setMarsFinishedCanyonChase(bool);
	bool getMarsFinishedCanyonChase();
	void setMarsThreadedMaze(bool);
	bool getMarsThreadedMaze();
	void setMarsHitRobotWithCannon(bool);
	bool getMarsHitRobotWithCannon();
	void setMarsReadyForShuttleTransport(bool);
	bool getMarsReadyForShuttleTransport();

	// WSC
	void setWSCSeenTimeStream(bool);
	bool getWSCSeenTimeStream();
	void setWSCPoisoned(bool);
	bool getWSCPoisoned();
	void setWSCAnsweredAboutDart(bool);
	bool getWSCAnsweredAboutDart();
	void setWSCRemovedDart(bool);
	bool getWSCRemovedDart();
	void setWSCAnalyzerOn(bool);
	bool getWSCAnalyzerOn();
	void setWSCDartInAnalyzer(bool);
	bool getWSCDartInAnalyzer();
	void setWSCAnalyzedDart(bool);
	bool getWSCAnalyzedDart();
	void setWSCSawMorph(bool);
	bool getWSCSawMorph();
	void setWSCDesignedAntidote(bool);
	bool getWSCDesignedAntidote();
	void setWSCPickedUpAntidote(bool);
	bool getWSCPickedUpAntidote();
	void setWSCOfficeMessagesOpen(bool);
	bool getWSCOfficeMessagesOpen();
	void setWSCSeenNerd(bool);
	bool getWSCSeenNerd();
	void setWSCHeardPage1(bool);
	bool getWSCHeardPage1();
	void setWSCHeardPage2(bool);
	bool getWSCHeardPage2();
	void setWSCHeardCheckIn(bool);
	bool getWSCHeardCheckIn();
	void setWSCDidPlasmaDodge(bool);
	bool getWSCDidPlasmaDodge();
	void setWSCSeenSinclairLecture(bool);
	bool getWSCSeenSinclairLecture();
	void setWSCBeenAtWSC93(bool);
	bool getWSCBeenAtWSC93();
	void setWSCCatwalkDark(bool);
	bool getWSCCatwalkDark();
	void setWSCRobotDead(bool);
	bool getWSCRobotDead();
	void setWSCRobotGone(bool);
	bool getWSCRobotGone();

protected:
	friend class Common::Singleton<SingletonBaseType>;

private:
	// Base
	NeighborhoodID _currentNeighborhood;
	RoomID _currentRoom;
	DirectionConstant _currentDirection;
	NeighborhoodID _nexNeighborhoodID;
	RoomID _nextRoomID;
	DirectionConstant _nextDirection;
	NeighborhoodID _lastNeighborhood;
	RoomID _lastRoom;
	DirectionConstant _lastDirection;
	RoomID _openDoorRoom;
	DirectionConstant _openDoorDirection;

	// Pegasus Prime
	FlagsArray<byte, kNumGlobalFlags> _globalFlags;
	FlagsArray<byte, kNumScoringFlags> _scoringFlags;
	FlagsArray<uint32, kNumItems> _itemTakenFlags;

	FlagsArray<byte, kNumCaldoriaFlags> _caldoriaFlags;
	TimeValue _caldoriaFuseTimeLimit;

	TimeValue _TSARipTimerTime;
	TimeValue _TSAFuseTimeLimit;
	byte _TSAState;
	byte _T0BMonitorMode;
	TimeValue _T0BMonitorStart;
	FlagsArray<byte, kNumTSAFlags> _TSAFlags;

	FlagsArray<byte, kNumPrehistoricFlags> _prehistoricFlags;

	FlagsArray<byte, kNumNoradFlags> _noradFlags;
	uint16 _noradSubRoomPressure;
	NoradSubPrepState _noradSubPrepState;

	FlagsArray<byte, kNumMarsFlags> _marsFlags;

	FlagsArray<byte, kNumWSCFlags> _WSCFlags;
};

} // End of namespace Pegasus

#define GameState (::Pegasus::GameStateManager::instance())

#endif