Skip to main content

SchematicLoader

class ThaumielMapEditor.API.Helpers

Overview​

Properties​

NameTypeAccessDescription
DeserializerIDeserializergetThe YAML deserializer used to parse schematic and map files
MapsByIdDictionary<Guid, MapData>get setA dictionary of all spawned ThaumielMapEditor.API.Data.MapData instances, keyed by their System.Guid.
SchematicsByIdDictionary<UInt32, SchematicData>get setA dictionary of all spawned ThaumielMapEditor.API.Data.SchematicData instances, keyed by their ID.
SerializerISerializergetThe YAML serializer used to write schematic and map files, configured with Pascal case naming and custom type converters.
SpawnedMapsIEnumerable<MapData>getAn enumerable of all currently spawned ThaumielMapEditor.API.Data.MapData instances.
SpawnedSchematicsIEnumerable<SchematicData>getAn enumerable of all currently spawned ThaumielMapEditor.API.Data.SchematicData instances.

Fields​

NameTypeDescription
LoadedMapsList<SerializableMap>This list contains all the maps loaded by `ThaumielMapEditor.API.Helpers.Schemat…
LoadedSchematicsDictionary<string, SerializableSchematic>This list contains all the schematics loaded by `ThaumielMapEditor.API.Helpers.S…
SchematicLODZonesDictionary<LODZone, SchematicData>dodad2
ServerSideTransformsDictionary<int, Transform>No description

Methods​

SignatureReturnsDescription
Cleanup()voidNo description
DestroyMap(MapData)voidDestroys a map.
DestroySchematic(SchematicData)voidDestroys the specified ThaumielMapEditor.API.Data.SchematicData
GetId()UInt32Gets a unique id for all ThaumielMapEditor.API.Data.SchematicData
GetSchematicById(UInt32)SchematicDataGets the ThaumielMapEditor.API.Data.SchematicData by its id.
Init()voidInitializes the ThaumielMapEditor.API.Helpers.SchematicLoader
LoadMaps()voidLoads the maps
LoadSchematics()voidLoads the schematics
LoadSchematicsFromDirectory(string)voidLoads all schematics from a custom directory into `ThaumielMapEditor.API.Helpers…
ReloadSchematics()voidReloads all loaded schematics
SaveMap(MapData)SerializableMapSaves a map
SetupCulling(SerializableObject, ServerObject, SchematicData)voidNo description
SetupCulling(SerializableObject, ClientSideObjectBase, SchematicData)voidNo description
SpawnMap(SerializableMap)MapDataSpawns a map
SpawnSchematic(SerializableSchematic, Vector3, Quaternion, Vector3)SchematicDataSpawns a schematic at the specified position, rotation, and scale.
SpawnSchematic(SerializableSchematic, Vector3, Quaternion)SchematicDataSpawns a schematic at the specified position and rotation with default scale.
SpawnSchematic(SerializableSchematic, Vector3)SchematicDataSpawns a schematic at the specified position with default rotation and scale.
SpawnSchematic(string, Vector3)SchematicDataSpawns a loaded schematic by name at the specified position with default rotatio…
SpawnSchematic(string, Vector3, Quaternion)SchematicDataSpawns a loaded schematic by name at the specified position and rotation with de…
SpawnSchematic(string, Vector3, Quaternion, Vector3)SchematicDataSpawns a loaded schematic by name at the specified position, rotation, and scale…
SpawnSchematicFromDirectory(string, string, Vector3)SchematicDataSpawns a schematic by name from a custom directory at the specified position wit…
SpawnSchematicFromDirectory(string, string, Vector3, Quaternion)SchematicDataSpawns a schematic by name from a custom directory at the specified position and…
SpawnSchematicFromDirectory(string, string, Vector3, Quaternion, Vector3)SchematicDataSpawns a schematic by name from a custom directory at the specified position, ro…
SpawnSchematicFromPath(string, Vector3)SchematicDataSpawns a schematic from a file path at the specified position with default rotat…
SpawnSchematicFromPath(string, Vector3, Quaternion)SchematicDataSpawns a schematic from a file path at the specified position and rotation with…
SpawnSchematicFromPath(string, Vector3, Quaternion, Vector3)SchematicDataSpawns a schematic from a file path at the specified position, rotation, and sca…
TryGetSchematicById(UInt32, SchematicData&)boolTries to get the ThaumielMapEditor.API.Data.SchematicData by its Id.

Properties​

Deserializer​

Type: IDeserializer Access: get

The YAML deserializer used to parse schematic and map files


MapsById​

Type: Dictionary<Guid, MapData> Access: get set

A dictionary of all spawned ThaumielMapEditor.API.Data.MapData instances, keyed by their System.Guid.


SchematicsById​

Type: Dictionary<UInt32, SchematicData> Access: get set

A dictionary of all spawned ThaumielMapEditor.API.Data.SchematicData instances, keyed by their ID.


Serializer​

Type: ISerializer Access: get

The YAML serializer used to write schematic and map files, configured with Pascal case naming and custom type converters.


SpawnedMaps​

Type: IEnumerable<MapData> Access: get

An enumerable of all currently spawned ThaumielMapEditor.API.Data.MapData instances.


SpawnedSchematics​

Type: IEnumerable<SchematicData> Access: get

An enumerable of all currently spawned ThaumielMapEditor.API.Data.SchematicData instances.


Fields​

LoadedMaps​

Type: List<SerializableMap>

This list contains all the maps loaded by ThaumielMapEditor.API.Helpers.SchematicLoader.LoadMaps Use ThaumielMapEditor.API.Helpers.SchematicLoader.SpawnedMaps to get the spawned maps.


LoadedSchematics​

Type: Dictionary<string, SerializableSchematic>

This list contains all the schematics loaded by ThaumielMapEditor.API.Helpers.SchematicLoader.LoadSchematics Use ThaumielMapEditor.API.Helpers.SchematicLoader.SpawnedSchematics to get the spawned schematics.


SchematicLODZones​

Type: Dictionary<LODZone, SchematicData>

dodad2


ServerSideTransforms​

Type: Dictionary<int, Transform>


Methods​

Cleanup​

Cleanup
public void Cleanup()

DestroyMap​

DestroyMap
public void DestroyMap(MapData map)

Destroys a map.

Parameters​

NameTypeDescription
mapMapDataThe ThaumielMapEditor.API.Data.MapData to be destroyed.

DestroySchematic​

DestroySchematic
public void DestroySchematic(SchematicData data)

Destroys the specified ThaumielMapEditor.API.Data.SchematicData

Parameters​

NameTypeDescription
dataSchematicDataThe schematic to be destroyed

GetId​

GetId
public UInt32 GetId()

Gets a unique id for all ThaumielMapEditor.API.Data.SchematicData

Returns​

UInt32 β€” System.UInt32 id


GetSchematicById​

GetSchematicById
public SchematicData GetSchematicById(UInt32 id)

Gets the ThaumielMapEditor.API.Data.SchematicData by its id.

Parameters​

NameTypeDescription
idUInt32The id to get

Returns​

SchematicData β€” ThaumielMapEditor.API.Data.SchematicData if found else returns null


Init​

Init
public void Init()

Initializes the ThaumielMapEditor.API.Helpers.SchematicLoader


LoadMaps​

LoadMaps
public void LoadMaps()

Loads the maps


LoadSchematics​

LoadSchematics
public void LoadSchematics()

Loads the schematics


LoadSchematicsFromDirectory​

LoadSchematicsFromDirectory
public void LoadSchematicsFromDirectory(string directory)

Loads all schematics from a custom directory into ThaumielMapEditor.API.Helpers.SchematicLoader.LoadedSchematics.

Parameters​

NameTypeDescription
directorystringThe full path to the directory to load schematics from.

ReloadSchematics​

ReloadSchematics
public void ReloadSchematics()

Reloads all loaded schematics

Remarks

This does not automatically respawn schematics


SaveMap​

SaveMap
public SerializableMap SaveMap(MapData data)

Saves a map

Parameters​

NameTypeDescription
dataMapDataThe ThaumielMapEditor.API.Data.MapData to save

Returns​

SerializableMap β€” ThaumielMapEditor.API.Serialization.SerializableMap


SetupCulling​

SetupCulling
public void SetupCulling(
SerializableObject serializable,
ServerObject obj,
SchematicData schematic
)

Parameters​

NameTypeDescription
serializableSerializableObject
objServerObject
schematicSchematicData

SetupCulling​

SetupCulling
public void SetupCulling(
SerializableObject serializable,
ClientSideObjectBase obj,
SchematicData schematic
)

Parameters​

NameTypeDescription
serializableSerializableObject
objClientSideObjectBase
schematicSchematicData

SpawnMap​

SpawnMap
public MapData SpawnMap(SerializableMap map)

Spawns a map

Parameters​

NameTypeDescription
mapSerializableMapThe serialized map to spawn

Returns​

MapData β€” ThaumielMapEditor.API.Data.MapData


SpawnSchematic​

SpawnSchematic
public SchematicData SpawnSchematic(
SerializableSchematic schematic,
Vector3 position,
Quaternion rotation,
Vector3 scale
)

Spawns a schematic at the specified position, rotation, and scale.

Parameters​

NameTypeDescription
schematicSerializableSchematicThe serialized schematic to spawn.
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.
scaleVector3The scale to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic.


SpawnSchematic​

SpawnSchematic
public SchematicData SpawnSchematic(
SerializableSchematic schematic,
Vector3 position,
Quaternion rotation
)

Spawns a schematic at the specified position and rotation with default scale.

Parameters​

NameTypeDescription
schematicSerializableSchematicThe serialized schematic to spawn.
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic.


SpawnSchematic​

SpawnSchematic
public SchematicData SpawnSchematic(
SerializableSchematic schematic,
Vector3 position
)

Spawns a schematic at the specified position with default rotation and scale.

Parameters​

NameTypeDescription
schematicSerializableSchematicThe serialized schematic to spawn.
positionVector3The world position at which to place the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic.


SpawnSchematic​

SpawnSchematic
public SchematicData SpawnSchematic(
string schematicname,
Vector3 position
)

Spawns a loaded schematic by name at the specified position with default rotation and scale.

Parameters​

NameTypeDescription
schematicnamestringThe file name of the schematic to spawn. Must match a schematic in ThaumielMapEditor.API.Helpers.SchematicLoader.LoadedSchematics.
positionVector3The world position at which to place the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic.


SpawnSchematic​

SpawnSchematic
public SchematicData SpawnSchematic(
string schematicname,
Vector3 position,
Quaternion rotation
)

Spawns a loaded schematic by name at the specified position and rotation with default scale.

Parameters​

NameTypeDescription
schematicnamestringThe file name of the schematic to spawn. Must match a schematic in ThaumielMapEditor.API.Helpers.SchematicLoader.LoadedSchematics.
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic.


SpawnSchematic​

SpawnSchematic
public SchematicData SpawnSchematic(
string schematicname,
Vector3 position,
Quaternion rotation,
Vector3 scale
)

Spawns a loaded schematic by name at the specified position, rotation, and scale.

Parameters​

NameTypeDescription
schematicnamestringThe file name of the schematic to spawn. Must match a schematic in ThaumielMapEditor.API.Helpers.SchematicLoader.LoadedSchematics.
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.
scaleVector3The scale to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic.


SpawnSchematicFromDirectory​

SpawnSchematicFromDirectory
public SchematicData SpawnSchematicFromDirectory(
string directory,
string schematicName,
Vector3 position
)

Spawns a schematic by name from a custom directory at the specified position with default rotation and scale.

Parameters​

NameTypeDescription
directorystringThe full path to the directory containing the schematic.
schematicNamestringThe file name of the schematic (without extension).
positionVector3The world position at which to place the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic, or null if the schematic could not be loaded.


SpawnSchematicFromDirectory​

SpawnSchematicFromDirectory
public SchematicData SpawnSchematicFromDirectory(
string directory,
string schematicName,
Vector3 position,
Quaternion rotation
)

Spawns a schematic by name from a custom directory at the specified position and rotation with default scale.

Parameters​

NameTypeDescription
directorystringThe full path to the directory containing the schematic.
schematicNamestringThe file name of the schematic (without extension).
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic, or null if the schematic could not be loaded.


SpawnSchematicFromDirectory​

SpawnSchematicFromDirectory
public SchematicData SpawnSchematicFromDirectory(
string directory,
string schematicName,
Vector3 position,
Quaternion rotation,
Vector3 scale
)

Spawns a schematic by name from a custom directory at the specified position, rotation, and scale.

Parameters​

NameTypeDescription
directorystringThe full path to the directory containing the schematic.
schematicNamestringThe file name of the schematic (without extension).
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.
scaleVector3The scale to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic, or null if the schematic could not be loaded.


SpawnSchematicFromPath​

SpawnSchematicFromPath
public SchematicData SpawnSchematicFromPath(
string path,
Vector3 position
)

Spawns a schematic from a file path at the specified position with default rotation and scale.

Parameters​

NameTypeDescription
pathstringThe full file path to the schematic YAML file.
positionVector3The world position at which to place the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic, or null if the file could not be loaded.


SpawnSchematicFromPath​

SpawnSchematicFromPath
public SchematicData SpawnSchematicFromPath(
string path,
Vector3 position,
Quaternion rotation
)

Spawns a schematic from a file path at the specified position and rotation with default scale.

Parameters​

NameTypeDescription
pathstringThe full file path to the schematic YAML file.
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic, or null if the file could not be loaded.


SpawnSchematicFromPath​

SpawnSchematicFromPath
public SchematicData SpawnSchematicFromPath(
string path,
Vector3 position,
Quaternion rotation,
Vector3 scale
)

Spawns a schematic from a file path at the specified position, rotation, and scale.

Parameters​

NameTypeDescription
pathstringThe full file path to the schematic YAML file.
positionVector3The world position at which to place the schematic.
rotationQuaternionThe rotation to apply to the schematic.
scaleVector3The scale to apply to the schematic.

Returns​

SchematicData β€” A ThaumielMapEditor.API.Data.SchematicData instance representing the spawned schematic, or null if the file could not be loaded.


TryGetSchematicById​

TryGetSchematicById
public bool TryGetSchematicById(
UInt32 id,
SchematicData& schematic
)

Tries to get the ThaumielMapEditor.API.Data.SchematicData by its Id.

Parameters​

NameTypeDescription
idUInt32The id to get
schematicSchematicData&The ThaumielMapEditor.API.Data.SchematicData if found

Returns​

bool β€” true if found else returns false if not