Class MountComponent
Inheritance
System.Object
MountComponent
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public sealed class MountComponent : WorldObjectComponent, ILinkable, IOwned, IController, IViewController, IHasUniversalID, IHasSerializableID, IRPCAuthChecks, INotifyPropertyChanged, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasInteractions, IHasEnvVars
Constructors
MountComponent()
Declaration
Fields
DismountEvent
global dismount event with user and seat
Declaration
public static ThreadSafeAction<User, int, MountComponent> DismountEvent
Field Value
MountEvent
global mount event with user and seat
Declaration
public static ThreadSafeAction<User, int, MountComponent> MountEvent
Field Value
Properties
Availability
Declaration
public override WorldObjectComponentClientAvailability Availability { get; }
Property Value
Overrides
Driver
Declaration
public Player Driver { get; set; }
Property Value
FirstFreeSeatIndex
Looking for null value in occupants array. Returns index of array if found, -1 if not.
Declaration
public int FirstFreeSeatIndex { get; }
Property Value
Type |
Description |
System.Int32 |
|
HasFreeSeat
Check for null values in occupants array. Returns true if found any.
Declaration
[EnvVar]
public bool HasFreeSeat { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsMounted
Return true if any player is mounted.
Declaration
public bool IsMounted { get; }
Property Value
Type |
Description |
System.Boolean |
|
MountedPlayers
Returns non-null collection with players that currently mounted.
Declaration
public IEnumerable<Player> MountedPlayers { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<Player> |
|
MountedPlayersNames
Returns the name of all the mounted player. Returns an empty string if there are not occupants.
Declaration
public string MountedPlayersNames { get; }
Property Value
Type |
Description |
System.String |
|
MountValidation
Declaration
public List<Func<int, Player, Result>> MountValidation { get; }
Property Value
Type |
Description |
System.Collections.Generic.List<System.Func<System.Int32, Player, Result>> |
|
OccupantIDs
Declaration
public int[] OccupantIDs { get; }
Property Value
Type |
Description |
System.Int32[] |
|
PauseExhaustion
Declaration
public bool PauseExhaustion { get; }
Property Value
Type |
Description |
System.Boolean |
|
Seats
Count all seats Mount has.
Declaration
public int Seats { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
Destroy()
Useful when object is destroyed with players inside
Declaration
public override void Destroy()
Overrides
Dismount(Player)
Dismounts specific player
from all occupied seats.
Declaration
public void Dismount(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Dismount(Int32)
Declaration
public void Dismount(int playerID)
Parameters
Type |
Name |
Description |
System.Int32 |
playerID |
|
DismountAll()
Declaration
public void DismountAll()
DismountAllWithAction(Action<Player>)
Declaration
public void DismountAllWithAction(Action<Player> action)
Parameters
Type |
Name |
Description |
System.Action<Player> |
action |
|
Initialize(Int32, Boolean)
Declaration
public void Initialize(int seats = 1, bool pauseExhaustion = true)
Parameters
Type |
Name |
Description |
System.Int32 |
seats |
|
System.Boolean |
pauseExhaustion |
|
MountInteraction(Player, InteractionTriggerInfo, InteractionTarget)
Declaration
[Interaction]
public void MountInteraction(Player player, InteractionTriggerInfo trigger, InteractionTarget target)
Parameters
MountSeat(Int32, Player)
Declaration
public void MountSeat(int seatIndex, Player player)
Parameters
Type |
Name |
Description |
System.Int32 |
seatIndex |
|
Player |
player |
|
MountSeatOnFree(Player)
Declaration
public int MountSeatOnFree(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Returns
Type |
Description |
System.Int32 |
|
OnPickup(Player)
dismount all in current mount on pickup.
Declaration
public override void OnPickup(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Overrides
TryDismountPlayer(Player)
Declaration
public void TryDismountPlayer(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Events
PlayerDismountedEvent
Called when a player dismounts (any of the seats)
Declaration
public event Action PlayerDismountedEvent
Event Type
Type |
Description |
System.Action |
|
PlayerMountedEvent
Called when a player mounts (any of the seats)
Declaration
public event Action PlayerMountedEvent
Event Type
Type |
Description |
System.Action |
|
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods