Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

MapPoint

GrafDimenzio edited this page Jan 2, 2021 · 4 revisions

MapPoint

The MapPoint object is a part of the Synapse Api and allows you the get any Position on the Map as a string and made it possible to Parse it later on an other Map Seed back to an Position.

It stores the relative Position to an Room so it is not possible to create a MapPoint in the void

You can get an MapPoint with:

  • MapPoint.TryParse() => tries to parse an string to an MapPoint
  • MapPoint.Parse() => Parse an string to an MapPoint (can throw an Error)
  • new MapPoint(string) => Like MapPoint.Parse()
  • new MapPoint(Room,Vector3) => Creates a MapPoint which is Relative to the Room

It contains the fields:

  • Room => The Room which is used as base Position
  • RelativePosition => The Relative Position the Position is away from the Room
  • Position => Gives you the RealPosition of the MapPoint on the current Map.

You can get the string from a MapPoint with mapPoint.ToString() or create it yourself with this layout: Roomname:x:y:z Example: HCZ_Room3ar:-1,792:1,330017:-0,004005589

SerializedMapPoint

If you want for some Reason to have a MapPoint which you can configure in the config.syml you can use the SerializedMapPoint Object in your IConfigSection.

In Order to get the MapPoint out of it just use serializedMapPoint.Parse()

Clone this wiki locally