Class WorldObjectItem
An item that has a singular corresponding world object it drops when placed.
Inheritance
System.Object
WorldObjectItem
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
[WorldSpaceItem]
[ItemGroup("World Object")]
public abstract class WorldObjectItem : DurabilityItem, IItem, ILinkableParameterized<LinkConfig>, ILinkable, IHasIcon, INotifyPropertyChanged, IPlaceableItem, IController, IViewController, IHasUniversalID
Constructors
WorldObjectItem()
Declaration
protected WorldObjectItem()
Fields
AllowWaterPlacement
Declaration
public static readonly Type[] AllowWaterPlacement
Field Value
Type |
Description |
System.Type[] |
|
Properties
Blockers
Declaration
public virtual Type[] Blockers { get; }
Property Value
Type |
Description |
System.Type[] |
|
Durability
Declaration
public float Durability { get; set; }
Property Value
Type |
Description |
System.Single |
|
GetOccupancyContext
Default occupancy config set to SideAttached
Declaration
protected virtual OccupancyContext GetOccupancyContext { get; }
Property Value
HomeValue
Declaration
public virtual HomeFurnishingValue HomeValue { get; }
Property Value
IsStackable
Declaration
public override bool IsStackable { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
OccupancyContext
Declaration
public OccupancyContext OccupancyContext { get; }
Property Value
ShouldCreate
If true, the system will automatically create the world object item when placed. If false, then the item must manually do it in 'PlacingObject'
Declaration
public virtual bool ShouldCreate { get; }
Property Value
Type |
Description |
System.Boolean |
|
ShowLocationsInWorld
If true, the tooltip of the item won't show the "ExistingObjects" section
Declaration
public virtual bool ShowLocationsInWorld { get; }
Property Value
Type |
Description |
System.Boolean |
|
WorldObjectType
Declaration
public abstract Type WorldObjectType { get; }
Property Value
Type |
Description |
System.Type |
|
Methods
CanMove(Player, Vector3i, Quaternion, INetObject)
This will check whether this item can be moved by the specified player to the specified position or not.
Declaration
protected virtual Task<bool> CanMove(Player player, Vector3i pos, Quaternion rotation, INetObject woNetObject)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
CanPlaceObject(Player, Vector3, Quaternion)
Override this function if you want to have async processing for Place Object action (like asking a citizen for confirmation).
Declaration
public virtual Task<bool> CanPlaceObject(Player player, Vector3 pos, Quaternion rotation)
Parameters
Type |
Name |
Description |
Player |
player |
|
System.Numerics.Vector3 |
pos |
|
Quaternion |
rotation |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Generates tooltip displaying list of all world objects created from this item type in the world
Declaration
public TooltipSection GetAllObjectsTooltip(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Returns
GetBlockTypesForDirection(Vector3i)
Declaration
public virtual Type[] GetBlockTypesForDirection(Vector3i direction)
Parameters
Type |
Name |
Description |
Vector3i |
direction |
|
Returns
Type |
Description |
System.Type[] |
|
GetCreatingItemTemplateFromType(Type)
Declaration
public static WorldObjectItem GetCreatingItemTemplateFromType(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
GetDurability()
Declaration
public override float GetDurability()
Returns
Type |
Description |
System.Single |
|
Overrides
GetMoveInfo(Player, INetObject)
Retrieves the initial info required for a WorldObject's movement, like deed/settlement restrictions and messages, calories required, etc.
Declaration
public MoveWorldObjectActionInfo GetMoveInfo(Player player, INetObject woNetObject)
Parameters
Returns
Initialize()
Declaration
public static void Initialize()
MakeItemFromWorldObjectType(Type)
Declaration
public static WorldObjectItem MakeItemFromWorldObjectType(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Move(Player, Vector3i, Quaternion, INetObject)
Attempts to move the WorldObject that this item represents, from its existing point to specified position and rotation.
Declaration
public Task<bool> Move(Player player, Vector3i pos, Quaternion rotation, INetObject woNetObject)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
OnPickup(WorldObject)
Declaration
public virtual void OnPickup(WorldObject placedObject)
Parameters
OnPostWorldObjectPlaced(WorldObject)
This called after the world object is placed, added to the world object manager and all its components initialized.
Declaration
public virtual void OnPostWorldObjectPlaced(WorldObject addedObject)
Parameters
OnPreWorldObjectPlaced(WorldObject)
This is called immediately before placement, before initialization and net object activation.
Declaration
public virtual void OnPreWorldObjectPlaced(WorldObject placedObject)
Parameters
Place(Player, Vector3, Quaternion, Int32)
RPC that attempts to place the WorldObject that is represented by this item.
Declaration
public void Place(Player player, Vector3 pos, Quaternion rotation, int placeOnSurfaceOfObjectID)
Parameters
Type |
Name |
Description |
Player |
player |
|
System.Numerics.Vector3 |
pos |
|
Quaternion |
rotation |
|
System.Int32 |
placeOnSurfaceOfObjectID |
|
PlacingObject(GameActionPack, Player, ItemStack, Vector3, Quaternion)
Do anything special that needs to be done when this thing is placed, by putting it into a game action pack. The future placed object can be retreived by
the passed func, inside posteffects (its assigned in a previous post effect, already setup to run when this is called)
Declaration
public virtual Task PlacingObject(GameActionPack pack, Player player, ItemStack containingStack, Vector3 pos, Quaternion rotation)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SetDurability(Single)
Declaration
public override void SetDurability(float dur)
Parameters
Type |
Name |
Description |
System.Single |
dur |
|
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods