Skip to main content

PlayerMapManager

A class in Root.Township, Alta.Map.

Map discovery state for one player (or the shared map): which pieces of each Map are uncovered. Kept by MapManager and saved in the player's map file.

Constructors​

MemberWhat it is
PlayerMapManager()Creates a PlayerMapManager from save.
PlayerMapManager(IAltaFile file)Creates a PlayerMapManager from save.
PlayerMapManager(MapSaveFormat save)Creates a PlayerMapManager from save.

Fields​

3 private and internal fields
MemberWhat it is
private IAltaFile fileThe player's map save file. Server: written after a piece is discovered.
private static Logger loggerNLog logger for this class.
private MapSaveFormat savePer-map piece states. True means the piece is still undiscovered.

Methods​

MemberWhat it is
bool DiscoverPiece(Map map, int pieceIndex)Marks a piece discovered and tells the map. Returns false if it already was. The server then saves the file.
IEnumerable<int> GetUndiscoveredMapPieces(Map map) (iterator)Indexes of the pieces not yet discovered on the map.
bool IsThisMapPieceDiscovered(Map map, int pieceIndex)True if the piece has been discovered.
void SyncMapManager(Stream stream)Reads or writes the discovery flags of every map. MapManager sends it to each player when they connect.
1 private and internal method
MemberWhat it is
private void SerializeMap(Map map, Stream stream)Syncs one map's piece states as one bool per piece.

Used in​

Members of other types that take, return or hold a PlayerMapManager: