1 #pragma once
2 #include "Observable.h"
3 #include "Types.h"
4 class DataReader;
5 class DataWriter;
6 class StrategicMapSecretModel;
7 
8 extern Observable<UINT8> OnMapSecretFound;
9 
10 // Reset the state of all map secrets
11 void InitMapSecrets();
12 
13 // Whether the town was found by the player. Returns TRUE if the town is not hidden (i.e. not defined in map secrets)
14 BOOLEAN IsTownFound(INT8 bTownID);
15 
16 // Whether the map secret was known to the player. Returns TRUE with a warning, if there is no secret at the sector ID.
17 BOOLEAN IsSecretFoundAt(UINT8 sectorID);
18 
19 // Marks the town's base sector as a found secret
20 void SetTownAsFound(INT8 bTownID, BOOLEAN fFound = TRUE);
21 
22 // set this SAM site as being found by the player
23 void SetSAMSiteAsFound(UINT8 uiSamIndex);
24 
25 // Marks a sector's secret as found
26 void SetSectorSecretAsFound(UINT8 ubSectorID, BOOLEAN fFound = TRUE);
27 
28 const StrategicMapSecretModel* GetMapSecretBySectorID(UINT8 ubSectorID);
29 
30 // writes the map secret states of all SAM sites
31 void InjectSAMSitesFoundToSavedFile(DataWriter& d);
32 
33 // reads the map secret states for all SAM sites
34 void ExtractSAMSitesFoundFromSavedFile(DataReader& d);
35 
36 // write the state of a non-SAM-site map secret at the given index
37 void InjectMapSecretStateToSave(DataWriter& d, unsigned int index);
38 
39 // Gets a non-SAM-site map secret state by index
40 BOOLEAN GetMapSecretStateForSave(unsigned int index);
41 
42 // reads a non-SAM-site map secret state from save
43 void ExtractMapSecretStateFromSave(DataReader & d, unsigned int index);
44 
45 // Sets a non-SAM-site map secret state by index
46 void SetMapSecretStateFromSave(unsigned int index, BOOLEAN fFound);