Class WorldObjectDebugUtil
Inheritance
System.Object
WorldObjectDebugUtil
Assembly: Eco.Gameplay.dll
Syntax
public static class WorldObjectDebugUtil : Object
Methods
AddFuelForObject(WorldObject)
Declaration
public static void AddFuelForObject(WorldObject worldObject)
Parameters
AddStorageForObject(WorldObject)
Declaration
public static StorageComponent AddStorageForObject(WorldObject worldObject)
Parameters
Returns
AddWorkOrderForObject(WorldObject, StorageComponent, Int32)
Declaration
public static void AddWorkOrderForObject(WorldObject obj, StorageComponent storage, int quantity = 10)
Parameters
ClearAbove(Vector3i, Int32)
Declaration
public static void ClearAbove(Vector3i pos, int countAbove = 10000)
Parameters
Type |
Name |
Description |
Vector3i |
pos |
|
System.Int32 |
countAbove |
|
CreateShaft(Vector2i, Vector3i, Player, Int32)
Declaration
public static void CreateShaft(Vector2i size, Vector3i position, Player player, int depth = 0)
Parameters
DeluxeSpawn(String, User, WrappedWorldPosition3i, WorldObjectDebugUtil.DeluxeSpawnFlags, Boolean, Int32)
Declaration
public static WorldObject DeluxeSpawn(string name, User user, WrappedWorldPosition3i position, WorldObjectDebugUtil.DeluxeSpawnFlags flags, bool findEmptySpace = false, int tier = 1)
Parameters
Returns
DeluxeSpawn(Type, User, WrappedWorldPosition3i, WorldObjectDebugUtil.DeluxeSpawnFlags, Boolean, Int32)
Declaration
public static WorldObject DeluxeSpawn(Type worldObjectType, User user, WrappedWorldPosition3i position, WorldObjectDebugUtil.DeluxeSpawnFlags flags, bool findEmptySpace = false, int tier = 1)
Parameters
Returns
EnsureComponentEnabled(WorldObjectComponent, String, CancellationToken)
Ensures component enabled and throws exception if it not enabled after default timeout.
Declaration
public static Task EnsureComponentEnabled(WorldObjectComponent component, string name = null, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
WorldObjectComponent |
component |
|
System.String |
name |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
EnsureComponentEnabled(WorldObjectComponent, TimeSpan, TimeSpan, String, CancellationToken)
Ensures component enabled and throws exception if it not enabled after timeout.
Declaration
public static Task EnsureComponentEnabled(WorldObjectComponent component, TimeSpan timeout, TimeSpan checkInterval, string name = null, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
WorldObjectComponent |
component |
|
System.TimeSpan |
timeout |
|
System.TimeSpan |
checkInterval |
|
System.String |
name |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
EnsureWorldObjectEnabled(WorldObject, String, CancellationToken)
Ensures world object enabled and throws exception if it not enabled after default timeout.
Declaration
public static Task EnsureWorldObjectEnabled(WorldObject worldObject, string name = null, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
WorldObject |
worldObject |
|
System.String |
name |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
EnsureWorldObjectEnabled(WorldObject, TimeSpan, TimeSpan, String, CancellationToken)
Ensures world object enabled and throws exception if it not enabled after timeout.
Declaration
public static Task EnsureWorldObjectEnabled(WorldObject worldObject, TimeSpan timeout, TimeSpan checkInterval, string name = null, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
WorldObject |
worldObject |
|
System.TimeSpan |
timeout |
|
System.TimeSpan |
checkInterval |
|
System.String |
name |
|
System.Threading.CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
EstablishTechTree(User)
Declaration
public static void EstablishTechTree(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
GetOrCreateObject(String, User, Vector3i, Single)
Declaration
public static WorldObject GetOrCreateObject(string name, User user, Vector3i pos, float distance = 10F)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
Vector3i |
pos |
|
System.Single |
distance |
|
Returns
LevelTerrain(Vector2i, WrappedWorldPosition3i, Player, Int32)
Level ground with grass block
Declaration
public static void LevelTerrain(Vector2i size, WrappedWorldPosition3i position, Player player, int replaceUnderground = 0)
Parameters
LevelTerrain(Vector2i, WrappedWorldPosition3i, Type, Player, Int32)
Level ground with defined block.
Declaration
public static void LevelTerrain(Vector2i size, WrappedWorldPosition3i position, Type blockType, Player player, int replaceUnderground = 0)
Parameters
LevelTerrainAsync(Vector2i, WrappedWorldPosition3i, Type, Player, Int32)
Levels the terrain using given parameters.
Declaration
public static Task LevelTerrainAsync(Vector2i size, WrappedWorldPosition3i position, Type blockType, Player player, int replaceUnderground = 0)
Parameters
Type |
Name |
Description |
Vector2i |
size |
The size at which the terrain should be levelled.
|
WrappedWorldPosition3i |
position |
the position at which the iteration starts, the leveling starts at the position and increments both x and z values.
|
System.Type |
blockType |
the type of the block to use while levelling, this need to be not solid.
|
Player |
player |
the player who started the command.
|
System.Int32 |
replaceUnderground |
should leveling replace underground to and to what levels, this is for clearing things such as pipes.
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
A task that the caller can wait for it or not.
|
RemoveBlock(WrappedWorldPosition3i)
Smart block remove function which is aware of plants and world objects.
Declaration
public static void RemoveBlock(WrappedWorldPosition3i worldPos)
Parameters
RemoveBlocksFromArea(Vector3i, Vector3i, Type, Boolean, Boolean)
Declaration
public static void RemoveBlocksFromArea(Vector3i size, Vector3i position, Type blockType, bool isTurnToGlass, bool removeAllOtherBlocks = false)
Parameters
Type |
Name |
Description |
Vector3i |
size |
|
Vector3i |
position |
|
System.Type |
blockType |
|
System.Boolean |
isTurnToGlass |
|
System.Boolean |
removeAllOtherBlocks |
|
ReplaceTerrain(Type, WorldPosition3i, Int32, Type, Boolean)
Replace terrain blocks on a certain block type. Works only for top blocks
Declaration
public static void ReplaceTerrain(Type blockTypeReplacement, WorldPosition3i center, int radius = 5, Type blockTypeOriginal = null, bool fullReplacement = false)
Parameters
Type |
Name |
Description |
System.Type |
blockTypeReplacement |
|
WorldPosition3i |
center |
|
System.Int32 |
radius |
|
System.Type |
blockTypeOriginal |
|
System.Boolean |
fullReplacement |
|
Spawn(String, User, Vector2i)
Declaration
public static WorldObject Spawn(string name, User user, Vector2i pos)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
Vector2i |
pos |
|
Returns
Spawn(String, User, Vector3i)
Declaration
public static WorldObject Spawn(string name, User user, Vector3i pos)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
Vector3i |
pos |
|
Returns
Spawn(Type, User, Vector2i)
Declaration
public static WorldObject Spawn(Type worldObjectType, User user, Vector2i pos)
Parameters
Type |
Name |
Description |
System.Type |
worldObjectType |
|
User |
user |
|
Vector2i |
pos |
|
Returns
Spawn(Type, User, Vector3i)
Declaration
public static WorldObject Spawn(Type worldObjectType, User user, Vector3i pos)
Parameters
Type |
Name |
Description |
System.Type |
worldObjectType |
|
User |
user |
|
Vector3i |
pos |
|
Returns
SpawnAndClaim(String, User, Vector2i)
Declaration
public static WorldObject SpawnAndClaim(string name, User user, Vector2i pos)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
Vector2i |
pos |
|
Returns
SpawnAndClaim(String, User, Nullable<Vector3i>)
Declaration
public static WorldObject SpawnAndClaim(string name, User user, Nullable<Vector3i> pos = null)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
System.Nullable<Vector3i> |
pos |
|
Returns
SpawnAndClaim(Type, User, Vector3i, Quaternion, Deed)
Declaration
public static WorldObject SpawnAndClaim(Type worldObjectType, User creator, Vector3i position, Quaternion rotation, Deed deed)
Parameters
Returns
SpawnAndClaim<T>(String, User, Vector2i)
Declaration
public static T SpawnAndClaim<T>(string name, User user, Vector2i pos)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
Vector2i |
pos |
|
Returns
Type Parameters
SpawnAndClaim<T>(String, User, Nullable<Vector3i>)
Declaration
public static T SpawnAndClaim<T>(string name, User user, Nullable<Vector3i> pos = null)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
System.Nullable<Vector3i> |
pos |
|
Returns
Type Parameters
SpawnGround(WorldObject)
Declaration
public static void SpawnGround(WorldObject obj)
Parameters
SpawnList(User, Vector3i, List<String>, WorldObjectDebugUtil.DeluxeSpawnFlags, Int32)
Function for spawning a list of WorldObjects in a custom position.
Declaration
public static List<WorldObject> SpawnList(User user, Vector3i startPos, List<string> namesOfItemsToSpawn, WorldObjectDebugUtil.DeluxeSpawnFlags flags, int tier = 1)
Parameters
Returns
Type |
Description |
System.Collections.Generic.List<WorldObject> |
|
SpawnList(User, List<String>, WorldObjectDebugUtil.DeluxeSpawnFlags, Int32)
Function for spawning a list of WorldObjects on User's position.
Declaration
public static List<WorldObject> SpawnList(User user, List<string> namesOfItemsToSpawn, WorldObjectDebugUtil.DeluxeSpawnFlags flags, int tier = 1)
Parameters
Returns
Type |
Description |
System.Collections.Generic.List<WorldObject> |
|
SpawnManyAndClaim(String, User, Int32)
Declaration
public static IEnumerable<WorldObject> SpawnManyAndClaim(string name, User user, int count)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
System.Int32 |
count |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<WorldObject> |
|
SpawnManyAndClaim(String, User, Int32, Vector3i, Vector3i)
Declaration
public static IEnumerable<WorldObject> SpawnManyAndClaim(string name, User user, int count, Vector3i pos, Vector3i increment)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
System.Int32 |
count |
|
Vector3i |
pos |
|
Vector3i |
increment |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<WorldObject> |
|
SpawnManyAndClaim<T>(String, User, Int32)
Declaration
public static IEnumerable<T> SpawnManyAndClaim<T>(string name, User user, int count)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
System.Int32 |
count |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
SpawnManyAndClaim<T>(String, User, Int32, Vector3i, Vector3i)
Declaration
public static IEnumerable<T> SpawnManyAndClaim<T>(string name, User user, int count, Vector3i pos, Vector3i increment)
Parameters
Type |
Name |
Description |
System.String |
name |
|
User |
user |
|
System.Int32 |
count |
|
Vector3i |
pos |
|
Vector3i |
increment |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
SpawnOnFlattenedGround(Type, User, Vector3i)
Spawn the world object on flattened ground.
Declaration
public static WorldObject SpawnOnFlattenedGround(Type worldObjectType, User user, Vector3i pos)
Parameters
Type |
Name |
Description |
System.Type |
worldObjectType |
|
User |
user |
|
Vector3i |
pos |
|
Returns
SpawnOnFlattenedGround(Type, User, Vector3i, Quaternion)
Spawn the world object on flattened ground.
Declaration
public static WorldObject SpawnOnFlattenedGround(Type worldObjectType, User user, Vector3i pos, Quaternion rotation)
Parameters
Returns
SpawnSignAtPos(User, Vector3, String, String, Direction)
Spawns a sign at specified position, optionally with custom material and look direction.
Declaration
public static void SpawnSignAtPos(User user, Vector3 position, string signText, string signObject = "SmallHangingStoneSignObject", Direction direction)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Numerics.Vector3 |
position |
|
System.String |
signText |
|
System.String |
signObject |
|
Direction |
direction |
|
ThrowIfNotRunning(WorldObject)
Declaration
public static void ThrowIfNotRunning(this WorldObject obj)
Parameters