Simulation.Slot Class Reference

A slot is a position in the world where an agent can run the interactions provided by the object that offers the slot. More...

Public Types

enum  SlotStates {
  SlotStates.Blocked, SlotStates.Reserved, SlotStates.ReadyCharacter, SlotStates.ReadyForAuction,
  SlotStates.CurrentlyOnAuction
}
 A slot is in one of these states at any time. More...
 
enum  Result {
  Result.Success, Result.NoAffordance, Result.NoInteraction, Result.UnclearFailure,
  Result.InteractionAlreadyRunning, Result.NoProlongableInteraction
}
 The result of an agent trying to use this slot More...
 

Public Member Functions

 Slot (Affordance affordance)
 Create a new slot More...
 
bool InterruptInteraction ()
 Interrupt the interaction currently running at this slot More...
 
float CurrentInteractionDuration ()
 Get the remaining duration of the currently running interaction. More...
 
bool ReserveSlot ()
 Set the state of the slot to reserved. More...
 
Result AgentArrivalEasy (AffordanceTreeNode participant)
 This tries to start a random interaction if no interaction is running and sets slot state to ReadyCharacter. More...
 
bool AgentDeparture ()
 Frees the slot for being offered to other agents. More...
 
bool OfferSlot ()
 Sets the slot state to currently being on auction More...
 
bool SetSlotBlocked ()
 Set the slot state to being blocked. More...
 

Properties

SlotStates SlotState [get]
 The current state of the slot. More...
 
Vector3 Position [get, set]
 World space position of the slot. More...
 
Vector3 LocalPosition [get, set]
 Please set the position relative to the slot's parent transform here More...
 
Vector3 LookAt [get, set]
 In world coordinates, where the agent should orient him/herself to More...
 
Vector3 LocalLookAt [get, set]
 The local position of he look at, where the agent should orient him/herself to, relative to the parents transform. More...
 
bool IsAuctionable [get, set]
 Whether the auction system is allowed to offer this slot to agents. More...
 
Interaction currentInteraction [get]
 Which interaction is currently running at this slot. More...
 

Detailed Description

A slot is a position in the world where an agent can run the interactions provided by the object that offers the slot.

Member Enumeration Documentation

The result of an agent trying to use this slot

Enumerator
Success 

No problem was determined as is slot used.

NoAffordance 

There as a problem with initialization and the affordance this slot belongs to is null.

NoInteraction 

There is no interaction available at the affordace this slot belongs to.

UnclearFailure 

There is some issue that lacks proper description

InteractionAlreadyRunning 

There is already an interaction running. This is not necessarily a problem, and can in many circumstances be considered a success.

NoProlongableInteraction 

When trying to prolong an interaction there was no such option.

A slot is in one of these states at any time.

Enumerator
Blocked 

A slot that is blocked for whatever reason can not be used by agents.

Reserved 

An agent reserved this slot for her/himself, and it is assumed that the agent is on the way to slot.

ReadyCharacter 

An agent is ready to interact with the slot, or interacting with the slot.

ReadyForAuction 

This slot can be auctioned, but is not currently auctioned

CurrentlyOnAuction 

Currently this slot is available for auctions.

Constructor & Destructor Documentation

Simulation.Slot.Slot ( Affordance  affordance)

Create a new slot

Parameters
affordanceThe affordance this slot will belong to.

Member Function Documentation

Result Simulation.Slot.AgentArrivalEasy ( AffordanceTreeNode  participant)

This tries to start a random interaction if no interaction is running and sets slot state to ReadyCharacter.

Parameters
participantThe agent that will be participating in the interactions of this slot.
Returns
The result of trying to start an interaction
bool Simulation.Slot.AgentDeparture ( )

Frees the slot for being offered to other agents.

Returns
float Simulation.Slot.CurrentInteractionDuration ( )

Get the remaining duration of the currently running interaction.

Returns
bool Simulation.Slot.InterruptInteraction ( )

Interrupt the interaction currently running at this slot

Returns
bool Simulation.Slot.OfferSlot ( )

Sets the slot state to currently being on auction

Returns
bool Simulation.Slot.ReserveSlot ( )

Set the state of the slot to reserved.

Returns
Will fail if the slot is blocked.
bool Simulation.Slot.SetSlotBlocked ( )

Set the slot state to being blocked.

Returns

Property Documentation

Interaction Simulation.Slot.currentInteraction
get

Which interaction is currently running at this slot.

bool Simulation.Slot.IsAuctionable
getset

Whether the auction system is allowed to offer this slot to agents.

Vector3 Simulation.Slot.LocalLookAt
getset

The local position of he look at, where the agent should orient him/herself to, relative to the parents transform.

Vector3 Simulation.Slot.LocalPosition
getset

Please set the position relative to the slot's parent transform here

Vector3 Simulation.Slot.LookAt
getset

In world coordinates, where the agent should orient him/herself to

Vector3 Simulation.Slot.Position
getset

World space position of the slot.

SlotStates Simulation.Slot.SlotState
get

The current state of the slot.


The documentation for this class was generated from the following file:
  • Slot.cs