Table of Contents

Class ClientMapSystem

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

The state both map panels share: which scene is being mapped, how much of it the character has explored, what they have pinned to it, and the overhead camera that photographs it.

public static class ClientMapSystem
Inheritance
ClientMapSystem
Inherited Members

Remarks

Why the panels do not each own this. The minimap and the world map draw the same world, and almost everything they need is expensive to have twice: a second fog grid is a second quarter-megabyte that has to be revealed in step with the first or the two maps disagree about where the player has been; a second overhead camera is a second full scene render every frame; a second note list is a second writer to the same file. Both panels are views onto this.

Lifetime. Driven entirely from SetCharacter(IPlayerCharacter) and Tick(), which the minimap calls — it is the panel that is always present. The world map reads the same state and works whether or not the minimap is open, but a build that removes the minimap panel entirely has to drive this from somewhere else.

Properties

Character

The character whose map is being shown.

public static IPlayerCharacter Character { get; }

Property Value

IPlayerCharacter

Definition

The current scene's map definition, or null when it has none.

public static WorldMapDefinition Definition { get; }

Property Value

WorldMapDefinition

DetailsCache

The scene details cache, supplied by whichever panel loads first.

public static WorldSceneDetailsCache DetailsCache { get; set; }

Property Value

WorldSceneDetailsCache

Filter

The rule deciding which markers may be drawn.

public static MapMarkerFilter Filter { get; }

Property Value

MapMarkerFilter

Fog

The character's explored map for the current scene, or null before one loads.

public static FogOfWarMap Fog { get; }

Property Value

FogOfWarMap

IsMapImageLoading

Whether the baked map image is still being loaded.

public static bool IsMapImageLoading { get; }

Property Value

bool

MapImage

The baked overhead image for the current scene, or null when there is none.

public static Texture2D MapImage { get; }

Property Value

Texture2D

MapRect

The world rectangle the current scene's map covers.

public static Rect MapRect { get; }

Property Value

Rect

Notes

The character's notes for the current scene.

public static List<MapNote> Notes { get; }

Property Value

List<MapNote>

Renderer

The overhead camera feeding the minimap.

public static MinimapCameraRenderer Renderer { get; }

Property Value

MinimapCameraRenderer

SceneDisplayName

The scene's player-facing name.

public static string SceneDisplayName { get; }

Property Value

string

SceneName

The scene the loaded state belongs to.

public static string SceneName { get; }

Property Value

string

Methods

AddNote(Vector3, string, string, int)

Adds a note at a world position.

public static MapNote AddNote(Vector3 position, string title, string text, int colorIndex)

Parameters

position Vector3

Where to pin it.

title string

The note's title.

text string

The note's body.

colorIndex int

Which palette colour to draw the pin in.

Returns

MapNote

The note, or null when the character's note allowance is full.

Flush()

Writes anything outstanding immediately.

public static void Flush()

Remarks

Called on scene change, character change and application quit. The debounce is a throughput optimisation, not a durability policy — every path that ends the current map's life has to close it out, or the last stretch of walking before a zone change is silently lost.

RemoveNote(long)

Removes a note.

public static bool RemoveNote(long noteID)

Parameters

noteID long

The note's identifier.

Returns

bool

True when a note was removed.

SetCharacter(IPlayerCharacter)

Points the map subsystem at a character, loading everything for the scene they are in.

public static void SetCharacter(IPlayerCharacter character)

Parameters

character IPlayerCharacter

The local player character, or null to tear down.

Shutdown()

Tears everything down. Called on quit to login.

public static void Shutdown()

Tick()

Advances the fog, and writes it when it has settled.

public static void Tick()

Remarks

Called from the minimap's per-frame update whether or not the minimap is visible. That is deliberate: exploration is something the character does by walking, not something they do by looking at a map, and tying it to the panel's visibility would mean a player who closed their minimap stopped revealing the world.

UpdateNote(long, string, string)

Replaces a note's text.

public static bool UpdateNote(long noteID, string title, string text)

Parameters

noteID long

The note's identifier.

title string

The new title.

text string

The new body.

Returns

bool

True when a note was found and updated.

Events

OnNotesChanged

Raised when a note is added, edited or removed.

public static event Action OnNotesChanged

Event Type

Action

OnSceneMapChanged

Raised when the loaded scene changes, so panels can rebuild everything derived from it.

public static event Action OnSceneMapChanged

Event Type

Action