Objective

Objective Class

The Objective is the interface for a user's Quest Objective

Syntax

[Sansar.Script.Interface]
public class Objective : Sansar.Script.InstanceInterface

See Also

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Members

See Also: Inherited members from Sansar.Script.InstanceInterface.

Public Properties

[read-only]
Agent Sansar.Script.SessionId . The session Id for the user on this quest.
  Count int . Get the number of objectives collected for this user.
[read-only]
Definition ObjectiveDefinition . The Sansar.Simulation.QuestDefinition for this quest.
[read-only]
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)
[read-only]
Ready bool . If the Objective data is ready.

Public Methods

  GetState () : ObjectiveState
The Sansar.Simulation.ObjectiveState representing the user's progress in the quest
  SetState (ObjectiveState)
Set the state of the objective.
  SetState (ObjectiveState, Action<Sansar.Script.OperationCompleteEvent>)
Set the state of the objective.
  Subscribe (ObjectiveState, Action<ObjectiveData>, bool) : Sansar.Script.IEventSubscription
Subscribes to Objective Events.
override
ToString () : string
A string representation of this object.
  Update ()
Update the ObjectiveDefinition data.
  Update (Action<Sansar.Script.OperationCompleteEvent>)
Update the ObjectiveDefinition data.

Member Details

Agent Property

The session Id for the user on this quest.

Syntax

[get: Sansar.Script.Interface]
public Sansar.Script.SessionId Agent { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Count Property

Get the number of objectives collected for this user.

Syntax

[get: Sansar.Script.Interface]
[set: Sansar.Script.Interface]
public int Count { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Returns -1 if the Objective is not Ready.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Definition Property

Syntax

[get: Sansar.Script.Interface]
public ObjectiveDefinition Definition { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

GetState Method

The Sansar.Simulation.ObjectiveState representing the user's progress in the quest

Syntax

[Sansar.Script.Interface]
public ObjectiveState GetState ()

Returns

Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Ready Property

If the Objective data is ready.

Syntax

[get: Sansar.Script.Interface]
public bool Ready { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Returns false until the data has been fetched from the quest service. Once it returns true it will always return true.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetState Method

Set the state of the objective.

Syntax

[Sansar.Script.Interface]
public void SetState (ObjectiveState state)

Parameters

state
The state to transition to.

Remarks

Some state changes may not be permitted, in these cases Sansar.Script.OperationCompleteEvent success will be false.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

SetState Method

Set the state of the objective.

Syntax

[Sansar.Script.Interface]
public void SetState (ObjectiveState state, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

state
The state to transition to.
handler
Handler to be called when the event completes.

Remarks

Some state changes may not be permitted, in these cases Sansar.Script.OperationCompleteEvent success will be false.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Subscribe Method

Subscribes to Objective Events.

Syntax

[Sansar.Script.Interface]
public Sansar.Script.IEventSubscription Subscribe (ObjectiveState State, Action<ObjectiveData> callback, bool persistent)

See Also

Parameters

State
The state of the objective
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.

Returns

An Sansar.Script.IEventSubscription that can be used to cancel the subscription.

Remarks

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

ToString Method

A string representation of this object.

Syntax

[Sansar.Script.Interface]
public override string ToString ()

Returns

A string representation of this object.

Remarks

The format of this string may change between releases.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Update Method

Update the ObjectiveDefinition data.

Syntax

[Sansar.Script.Interface]
public void Update ()

Remarks

Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0

Update Method

Update the ObjectiveDefinition data.

Syntax

[Sansar.Script.Interface]
public void Update (Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

handler
Handler to be called when the event completes.

Remarks

Use in a WaitFor to wait for the data for the QuestDefinition to be ready. Once data is retrieved and Ready is true it will never again be false.

Requirements

Namespace: Sansar.Simulation
Assembly: Sansar.Simulation (in Sansar.Simulation.dll)
Assembly Versions: 1.1.0.0


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.