Empeld
Empeld plugin documentation.
essentials.action.Entities.Actor.PlayableBase Class Reference

Represents default functionality for a controllable user More...

Inheritance diagram for essentials.action.Entities.Actor.PlayableBase:
essentials.action.Entities.Actor.NewtonianBase pluginbase.Objects.Syncable.Entity.Controllers.IPlayableEntity pluginbase.Objects.Syncable.Entity.Controllers.IBoundInputEntity essentials.action.Entities.Actor.AttachableActorBase essentials.action.Entities.Actor.INewtonianEntity essentials.action.Entities.Actor.IRepulsiveEntity pluginbase.Objects.Syncable.Entity.IActor pluginbase.Objects.Syncable.Entity.IEntity pluginbase.Objects.Syncable.Entity.Controllers.IEntityController essentials.action.Entities.Actor.ActorBase essentials.action.Entities.Actor.IAttachableActor pluginbase.Objects.Syncable.Entity.IActor pluginbase.Objects.Syncable.Entity.IPositionableEntity pluginbase.Objects.Syncable.Entity.Controllers.IModelEntity pluginbase.Objects.Syncable.Entity.Controllers.IEntityController pluginbase.Objects.Syncable.Entity.IPositionableEntity pluginbase.Objects.Syncable.Entity.IEntity pluginbase.Objects.Syncable.Entity.Controllers.IModelEntity pluginbase.Objects.Syncable.Entity.IActor pluginbase.Objects.Syncable.Entity.Controllers.IComponentizedEntity pluginbase.Objects.Syncable.Entity.IMutableActor pluginbase.Objects.Syncable.Entity.EntityBase essentials.action.Entities.Basic.GuyEntity

Public Member Functions

 PlayableBase ()
 
- Public Member Functions inherited from essentials.action.Entities.Actor.NewtonianBase
 NewtonianBase ()
 
- Public Member Functions inherited from essentials.action.Entities.Actor.ActorBase
virtual void SetPosition (double x, double y, double z)
 Sets the position. More...
 
virtual void SetName (string name)
 
- Public Member Functions inherited from pluginbase.Objects.Syncable.Entity.EntityBase
void Destroy ()
 Marks the entity for destruction More...
 
override string ToString ()
 Gets a human-readable string representing an entity More...
 
- Public Member Functions inherited from pluginbase.Objects.Syncable.INetSyncable
void ResetWatch ()
 Resets the watch. Overridable to reset all sub-items More...
 
void EncodeTo (BinaryWriter writer, EncodeContext context)
 Encodes to. More...
 
void DecodeFrom (BinaryReader reader, DecodeContext context)
 Decodes from. More...
 
void Persist (IPersistObject obj)
 Persist the network object to a persist object More...
 
void Load (IReadPersistObject obj)
 Load the network object from a persist object More...
 
- Public Member Functions inherited from pluginbase.Objects.Syncable.INetWatcher
void Touch ()
 Touch the class, signalling that a change ocurred More...
 
void TouchRecurse ()
 Touches a class and any sub-classes it may have More...
 

Protected Member Functions

virtual void ConfigureInput (IInputBinding binding)
 Configure input binding More...
 
- Protected Member Functions inherited from essentials.action.Entities.Actor.NewtonianBase
virtual void SimulateClientPhysics (IFrameTimeState frameTime)
 
virtual void SimulateAudio (IFrameTimeState frameTime)
 
virtual bool ShouldOverrideAnimation (ModelAnimation animation)
 
virtual ModelAnimation GetAnimation ()
 
void SetAnimation (ModelAnimation animation, ModelAnimationFlag flag=ModelAnimationFlag.InterruptRepeat)
 
void SetAnimation (string slug, ModelAnimationFlag flag=ModelAnimationFlag.Default)
 
bool DoesCollide (Vector3d pos, double heightOffset=0.5)
 Detects whether or not the entity will collide with a block at a given point More...
 
void AddPhysicalVelocity (Vector3d vel)
 
virtual void OnCollided (Vector3d velDiff)
 
virtual void SimulateServerPhysics (IFrameTimeState timeState)
 
- Protected Member Functions inherited from essentials.action.Entities.Actor.AttachableActorBase
 AttachableActorBase ()
 
IActor GetAttachedActor ()
 
void AttachTo (uint actorId)
 
void AttachTo (IActor actor)
 
void Detach ()
 
- Protected Member Functions inherited from essentials.action.Entities.Actor.ActorBase
sealed override bool ShouldSyncWith (IPositionableEntity user)
 Gets whether or not the entity shuold sync with another entity More...
 
abstract IModelInstance CreateModel ()
 
- Protected Member Functions inherited from pluginbase.Objects.Syncable.Entity.EntityBase
void SetTransient (bool isTransient=true)
 Sets whether or not the entity will be persisted Transient entities will not be persisted More...
 
virtual void OnServerSpawn ()
 Raises the server spawn event. Will only be called once, even across reloads More...
 
virtual void OnServerDestroy ()
 Raises the server destroy event. More...
 
void InvokeRemotely (string methodName, RpcTarget target, params object[] args)
 Invoke a remote method on a target More...
 
void InvokeRemotely< T > (string methodName, RpcTarget target, Action< RpcNetworkContext, T > returnCallback, params object[] args)
 Invoke a remote method on a target More...
 
void InvokeRemotely< T > (string methodName, RpcTarget target, Action< T > returnCallback, params object[] args)
 Invoke a remote method on a target More...
 
void InvokeRemotely (RpcTarget target, Expression< Action > thisExpression)
 Invokes a remote target with an expression More...
 
void InvokeDirect (string methodName, params object[] args)
 Invoke a remote method on the opposite-owner eg. if this is the server, than on the client owner, otherwise on the server More...
 
void InvokeDirect< T > (string methodName, Action< RpcNetworkContext, T > returnCallback, params object[] args)
 Invoke a remote method on the opposite-owner eg. if this is the server, than on the client owner, otherwise on the server More...
 
void InvokeDirect< T > (string methodName, Action< T > returnCallback, params object[] args)
 Invoke a remote method on the opposite-owner eg. if this is the server, than on the client owner, otherwise on the server More...
 
void InvokeDirect (Expression< Action > thisExpression)
 Invokes a method on the opposite-owner. Action must act upon this More...
 
void InvokeDirect< TRet > (Expression< Func< TRet >> thisExpression, Action< TRet > returnCallback)
 Invokes a method on the opposite-owner. Action must act upon this More...
 
- Protected Member Functions inherited from pluginbase.Objects.Syncable.SyncableObject
 SyncableObject ()
 Initializes a new instance of the pluginbase.Objects.Syncable.SyncableObject class. More...
 
sealed override void ResetWatch ()
 Reset variables watched status More...
 
sealed override void TouchRecurse ()
 Touch self, including all children of this syncable object More...
 
sealed override void EncodeTo (BinaryWriter writer, EncodeContext context)
 Encode changes to binary data More...
 
sealed override void DecodeFrom (BinaryReader reader, DecodeContext context)
 Decode changes from binary data More...
 
sealed override void Persist (IPersistObject obj)
 Build up a persistant object for this syncable, including all sync children and persist objects More...
 
sealed override void Load (IReadPersistObject obj)
 Load a given persistent object back into this instance More...
 
- Protected Member Functions inherited from pluginbase.Objects.Syncable.SyncableBase< SyncableObject >
void Touch ()
 Touch the instance, notifying something has changed More...
 
virtual void OnChanged ()
 Raises the changed event. More...
 
abstract void Persist (IPersistObject obj)
 Persist the instance to a persist object More...
 
abstract void Load (IReadPersistObject obj)
 Load the instance from a persist object More...
 

Protected Attributes

readonly ITaskScheduler TaskScheduler
 
- Protected Attributes inherited from essentials.action.Entities.Actor.NewtonianBase
readonly IWorld World
 
readonly IResourceResolver EssentialsActionResources
 
readonly IBlockLookup BlockLookup
 
virtual bool TreatAllBlocksSloped => false
 If we treat all blocks as sloped, that will allow the driver to walk up even flat-faced blocks (eg structural) Primarily to allow AI path navigation without "jumping" More...
 
Vector3d RequestedVelocity
 The requested velocity to be traveling Will apply if physically makes sense More...
 
Vector3d RequestedAcceleration
 Requested acceleration More...
 

Properties

virtual bool IsCrouched [get]
 Gets whether or not the entity is crouched More...
 
override double EntityHeight [get]
 Gets the height of the entity. Used for collision and camera offset by default More...
 
virtual Vector3d CameraOffset [get]
 Gets the offset of the camera from the position of the entity More...
 
Vector3d CameraPosition [get]
 Gets the absolute position of the camera (Position + CameraOffset) More...
 
virtual double FieldOfViewOverride [get]
 Gets the field of view override More...
 
virtual Rotation2d CameraRotationOffset [get]
 Gets the offset applied to the entities rotation More...
 
virtual double CameraBounceBaseline [get]
 Gets the minimum intensity of the camera bounce More...
 
virtual double CameraBounceIntensity [get]
 Gets the intensity multipler for the speed of the entity More...
 
virtual double CameraBounceSpeedIntensity [get]
 Gets how fast the camera will bounce relative to speed More...
 
virtual double WalkSpeed [get]
 Gets the walking speed More...
 
virtual double BackupSpeed [get]
 Gets reverse-walking speed More...
 
virtual double StrafeSpeed [get]
 Gets strafe speed More...
 
virtual double SprintSpeed [get]
 Get speed of sprinting (default: 1.8*Walk) More...
 
virtual double JumpVelocity [get]
 Gets the velocity applied to entity for jump More...
 
virtual bool CanSprint [get]
 Gets whether or not the entity can sprint More...
 
virtual bool CanSwim [get]
 Gets whether or not the entity can swim More...
 
virtual bool CanMove [get]
 Gets whether or not the entity can move More...
 
virtual bool CanRotate [get]
 Gets whether or not the entity can rotate More...
 
- Properties inherited from essentials.action.Entities.Actor.NewtonianBase
IBlockAudioManager AudioBlocks [get]
 
IAudioManager AudioManager [get]
 
virtual SoundDescriptor FallingWindSound [get]
 
virtual double FallingWindVelocity [get]
 
virtual bool HasGravity [get]
 Gets a value indicating whether this instance has gravity. Defaults always true More...
 
IBlock HeadBlock [get]
 
IBlock OnBlock [get]
 
virtual bool OnGround [get]
 Gets a value indicating whether this user on ground. More...
 
virtual bool InLiquid [get]
 
virtual bool IsUnderwater [get]
 
virtual bool InClimbable [get]
 
virtual double EntityHeight [get]
 Gets the height of the entity. More...
 
virtual double EntityRepulsionStrength [get]
 Strength at which another entity is repulsed by this one More...
 
virtual double EntityRepulsiveModifier [get]
 The multiplicative modifier of which a repulsive entities' strength is multiplied More...
 
virtual double EntityRadius [get]
 Gets the entity radius. Used in collision More...
 
virtual double UserVelocityAcceleration [get]
 How fast can the user velocity change More...
 
virtual double UserVelocityMultiplier [get]
 How much does the user velocity affect the physical engine. Defaults to full on ground, none in air More...
 
virtual double UserAccelerationMultiplier [get]
 How much does the requested acceleration affect the game physics More...
 
virtual double ClientMovementUpdateTolerance [get]
 
Vector3d GravityVector [get]
 
virtual double Density [get]
 
Vector3d Velocity [get]
 Calculated velocity (not sync'd) More...
 
- Properties inherited from essentials.action.Entities.Actor.AttachableActorBase
sealed override Vector3d Position [get, protected set]
 
Vector3d RelativePosition [get, protected set]
 
sealed override Rotation2d Rotation [get, protected set]
 
bool IsAttached [get]
 
- Properties inherited from essentials.action.Entities.Actor.ActorBase
virtual Vector3d Position [get, protected set]
 
bool PositionFinishedInterpolating [get]
 
virtual Rotation2d Rotation [get, protected set]
 
bool IsPlayer [get]
 
bool IsMe [get]
 
string Name [get, protected set]
 
virtual string NamePlate [get]
 
virtual double NamePlateViewDistance [get]
 
virtual Vector3d NamePlateOffset [get]
 
virtual double SyncDistance [get]
 
virtual Vector3d UpVector [get]
 
IModelInstance Model [get]
 
virtual bool Visible [get]
 
virtual bool CastShadow [get]
 
- Properties inherited from pluginbase.Objects.Syncable.Entity.EntityBase
bool Spawned [get]
 Gets a value indicating whether this entity has been spawned More...
 
uint ObjectId [get]
 Gets or sets the object identifier. (aka entity id) More...
 
ushort OwnerId [get]
 The ident of the owner of the obejct More...
 
sealed override ushort NetOwnerId [get]
 Who owns me?! (Net ID) This is how we pass information down to SyncableObject More...
 
bool IsServer [get]
 Is the current object instantiated on the server More...
 
ushort ObjectTypeId [get]
 The type ID of the object, as defined by the entity attribute More...
 
- Properties inherited from pluginbase.Objects.Syncable.SyncableObject
virtual ushort NetOwnerId [get]
 Gets the network owner of this object (user id) More...
 
- Properties inherited from pluginbase.Objects.Syncable.Entity.IEntity
uint ObjectId [get]
 Gets the object identifier. More...
 
ushort OwnerId [get]
 Gets the owner identifier. (Net Ident) More...
 
ushort ObjectTypeId [get]
 Gets the object type identifier, as defined by the attribute More...
 
bool DestroyFlag [get]
 Gets a value indicating whether this pluginbase.Objects.Syncable.Entity.IEntity is destroyable. More...
 
bool Spawned [get]
 Gets a value indicating whether this entity has been spawned More...
 
bool Transient [get]
 Gets a value indicating whether this entity is transient (Won't be saved) More...
 
- Properties inherited from pluginbase.Objects.Syncable.INetSyncable
INetWatcher Watcher [get, set]
 Who is watching (who to inform of a change) More...
 
bool Modified [get]
 Gets a value indicating whether this pluginbase.Objects.Syncable.INetSyncable is modified. More...
 
- Properties inherited from pluginbase.Objects.Syncable.Entity.IMutableActor
bool IsPlayer [set]
 
bool IsMe [set]
 
- Properties inherited from pluginbase.Objects.Syncable.Entity.IActor
string Name [get]
 
- Properties inherited from pluginbase.Objects.Syncable.Entity.Controllers.IModelEntity
IModelInstance Model [get]
 The instance of the model used for the entity More...
 
string NamePlate [get]
 The name plate displayed for the entity, if any More...
 
double NamePlateViewDistance [get]
 The distance the name plate can be viewed from More...
 
Vector3d NamePlateOffset [get]
 The offset of the nameplate from the position of the entity More...
 
bool Visible [get]
 Gets a value indicating whether the entity is visible More...
 
bool CastShadow [get]
 Gets a value indiciating whether the entity casts a shadow More...
 
- Properties inherited from pluginbase.Objects.Syncable.Entity.IPositionableEntity
Vector3d Position [get]
 Gets the position. More...
 
Vector3d UpVector [get]
 Gets up vector. More...
 
Rotation2d Rotation [get]
 Gets the rotation. More...
 
- Properties inherited from essentials.action.Entities.Actor.IAttachableActor
bool IsAttached [get]
 Is attached to another entity More...
 
- Properties inherited from essentials.action.Entities.Actor.INewtonianEntity
Vector3d Velocity [get]
 
Vector3d Acceleration [get]
 
double EntityHeight [get]
 
double EntityRadius [get]
 
- Properties inherited from essentials.action.Entities.Actor.IRepulsiveEntity
double EntityRepulsionStrength [get]
 Linear strength at which this entity is repulsed by another More...
 
- Properties inherited from pluginbase.Objects.Syncable.Entity.Controllers.IPlayableEntity
Vector3d CameraOffset [get]
 Gets the camera offset compared to the Position of the entity More...
 
Rotation2d CameraRotationOffset [get]
 Gets the camera rotation offset. More...
 
double FieldOfViewOverride [get]
 Gets the field of view override More...
 

Additional Inherited Members

- Public Attributes inherited from essentials.action.Entities.Actor.NewtonianBase
Vector3d UserVelocity => this._userVelocity
 non-physical velocity (eg. not gravity/pushing/etc) More...
 
Vector3d Acceleration => this._acceleration
 Real acceleration of the entity More...
 
- Events inherited from pluginbase.Objects.Syncable.SyncableBase< SyncableObject >
Action< T > Changed
 Event triggered when any change occurs on this object, either locally or over the network More...
 
Action< T > NetUpdate
 Event triggered when a change occurs resulting from a change over the network More...
 
Action< T > Touched
 Event occurs only when an object is first touched. Usually the first instance of a local-change More...
 

Detailed Description

Represents default functionality for a controllable user

Constructor & Destructor Documentation

◆ PlayableBase()

essentials.action.Entities.Actor.PlayableBase.PlayableBase ( )
34  {
35  this.InjectDependencies();
36  }

Member Function Documentation

◆ ConfigureInput()

virtual void essentials.action.Entities.Actor.PlayableBase.ConfigureInput ( IInputBinding  binding)
protectedvirtual

Configure input binding

Parameters
bindingBinding.

Implements pluginbase.Objects.Syncable.Entity.Controllers.IBoundInputEntity.

55  {
56  _input = binding;
57 
58  binding.Description = "Player Controls";
59  binding.Listen(KeyNames.FORWARD, Key.W);
60  binding.Listen(KeyNames.BACKWARD, Key.S);
61  binding.Listen(KeyNames.LEFT, Key.A);
62  binding.Listen(KeyNames.RIGHT, Key.D);
63  binding.Listen(KeyNames.CROUCH, Key.ControlLeft);
64  binding.Listen(KeyNames.JUMP, Key.Space);
65  binding.Listen(KeyNames.SPRINT, Key.ShiftLeft);
66  }
string Description
Gets or sets the description.
Definition: IInputBinding.cs:22
void Listen(string bindName, Key defaultKey)
Listen to a key, with the assigned bind name

Member Data Documentation

◆ TaskScheduler

readonly ITaskScheduler essentials.action.Entities.Actor.PlayableBase.TaskScheduler
protected

Attribute: Dependency

Property Documentation

◆ BackupSpeed

virtual double essentials.action.Entities.Actor.PlayableBase.BackupSpeed
getprotected

Gets reverse-walking speed

The backup speed.

◆ CameraBounceBaseline

virtual double essentials.action.Entities.Actor.PlayableBase.CameraBounceBaseline
getprotected

Gets the minimum intensity of the camera bounce

The camera bounce baseline.

◆ CameraBounceIntensity

virtual double essentials.action.Entities.Actor.PlayableBase.CameraBounceIntensity
getprotected

Gets the intensity multipler for the speed of the entity

The camera bounce intensity.

◆ CameraBounceSpeedIntensity

virtual double essentials.action.Entities.Actor.PlayableBase.CameraBounceSpeedIntensity
getprotected

Gets how fast the camera will bounce relative to speed

The camera bounce speed intensity.

◆ CameraOffset

virtual Vector3d essentials.action.Entities.Actor.PlayableBase.CameraOffset
get

Gets the offset of the camera from the position of the entity

The camera offset.

◆ CameraPosition

Vector3d essentials.action.Entities.Actor.PlayableBase.CameraPosition
get

Gets the absolute position of the camera (Position + CameraOffset)

The camera position.

◆ CameraRotationOffset

virtual Rotation2d essentials.action.Entities.Actor.PlayableBase.CameraRotationOffset
get

Gets the offset applied to the entities rotation

The camera rotation offset.

◆ CanMove

virtual bool essentials.action.Entities.Actor.PlayableBase.CanMove
getprotected

Gets whether or not the entity can move

true if this instance can move; otherwise, false.

◆ CanRotate

virtual bool essentials.action.Entities.Actor.PlayableBase.CanRotate
getprotected

Gets whether or not the entity can rotate

true if this instance can rotate; otherwise, false.

◆ CanSprint

virtual bool essentials.action.Entities.Actor.PlayableBase.CanSprint
getprotected

Gets whether or not the entity can sprint

true if this instance can sprint; otherwise, false.

◆ CanSwim

virtual bool essentials.action.Entities.Actor.PlayableBase.CanSwim
getprotected

Gets whether or not the entity can swim

true if this instance can swim; otherwise, false.

◆ EntityHeight

override double essentials.action.Entities.Actor.PlayableBase.EntityHeight
get

Gets the height of the entity. Used for collision and camera offset by default

The height of the entity.

◆ FieldOfViewOverride

virtual double essentials.action.Entities.Actor.PlayableBase.FieldOfViewOverride
get

Gets the field of view override

The field of view in degrees.

◆ IsCrouched

virtual bool essentials.action.Entities.Actor.PlayableBase.IsCrouched
get

Gets whether or not the entity is crouched

true if this instance is crouched; otherwise, false.

◆ JumpVelocity

virtual double essentials.action.Entities.Actor.PlayableBase.JumpVelocity
get

Gets the velocity applied to entity for jump

The jump velocity.

◆ SprintSpeed

virtual double essentials.action.Entities.Actor.PlayableBase.SprintSpeed
get

Get speed of sprinting (default: 1.8*Walk)

The sprint speed.

◆ StrafeSpeed

virtual double essentials.action.Entities.Actor.PlayableBase.StrafeSpeed
get

Gets strafe speed

The strafe speed.

◆ WalkSpeed

virtual double essentials.action.Entities.Actor.PlayableBase.WalkSpeed
getprotected

Gets the walking speed

The walk speed.


The documentation for this class was generated from the following file: