Player

scroll.internal.compartment.impl.Compartment.Player
implicit class Player[W <: AnyRef](val wrapped: W)(implicit evidence$1: ClassTag[W]) extends IPlayer[W, Player[W]], SCROLLDynamic

Attributes

Graph
Supertypes
class IPlayer[W, Player[W]]
trait Dynamic
trait Dispatchable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

protected class TransferToBuilder[R <: AnyRef](role: R)(implicit evidence$1: ClassTag[R])

Attributes

Inherited from:
IPlayer
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

override def applyDynamic[E](name: String)(args: Any*)(using dispatchQuery: DispatchQuery): Either[SCROLLError, E]

Allows to call a function with arguments.

Allows to call a function with arguments.

Type parameters

E

return type

Value parameters

args

the arguments handed over to the given function

dispatchQuery

the dispatch rules that should be applied

name

the function name

Attributes

Returns

the result of the function call or an appropriate error

Definition Classes
override def applyDynamicNamed[E](name: String)(args: (String, Any)*)(using dispatchQuery: DispatchQuery): Either[SCROLLError, E]

Allows to call a function with named arguments.

Allows to call a function with named arguments.

Type parameters

E

return type

Value parameters

args

tuple with the the name and argument handed over to the given function

dispatchQuery

the dispatch rules that should be applied

name

the function name

Attributes

Returns

the result of the function call or an appropriate error

Definition Classes
def hashCode()(using dispatchQuery: DispatchQuery): Int
override def selectDynamic[E](name: String)(using dispatchQuery: DispatchQuery): Either[SCROLLError, E]

Allows to read a field.

Allows to read a field.

Type parameters

E

return type

Value parameters

dispatchQuery

the dispatch rules that should be applied

name

of the field

Attributes

Returns

the result of the field access or an appropriate error

Definition Classes
def toString()(using dispatchQuery: DispatchQuery): String
override def updateDynamic(name: String)(value: Any)(using dispatchQuery: DispatchQuery): Unit

Allows to write field updates.

Allows to write field updates.

Value parameters

dispatchQuery

the dispatch rules that should be applied

name

of the field

value

the new value to write

Attributes

Definition Classes

Inherited methods

def <+>[R <: AnyRef : ClassTag](role: R): Player[W]

Alias for IPlayer.play.

Alias for IPlayer.play.

Type parameters

R

type of role

Value parameters

role

the role that should be played

Attributes

Returns

this

Inherited from:
IPlayer
infix def <->(role: AnyRef): Player[W]

Alias for IPlayer.drop.

Alias for IPlayer.drop.

Value parameters

role

the role that should be removed

Attributes

Returns

this

Inherited from:
IPlayer
infix def <=>[R <: AnyRef : ClassTag](role: R): W

Alias for IPlayer.playing.

Alias for IPlayer.playing.

Type parameters

R

type of role

Value parameters

role

the role that should played

Attributes

Returns

the player instance

Inherited from:
IPlayer
override def dispatch[E](on: AnyRef, m: Method, args: Seq[Any]): Either[InvocationError, E]

For reflective dispatch.

For reflective dispatch.

Type parameters

E

the return type of method m

Value parameters

args

the arguments to pass to method m

m

the method to dispatch

on

the instance to dispatch the given method m on

Attributes

Returns

the resulting return value of the method invocation or an appropriate error

Definition Classes
Inherited from:
SCROLLDispatchable
infix def drop(role: AnyRef): Player[W]

Removes the play relation between core and role.

Removes the play relation between core and role.

Value parameters

role

the role that should be removed

Attributes

Returns

this

Inherited from:
IPlayer
override def equals(o: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
IPlayer -> Any
Inherited from:
IPlayer

Returns a Seq of all facets attached to this player.

Returns a Seq of all facets attached to this player.

Attributes

Returns

a Seq of all facets of this player including the player object itself. Returns an empty Seq if this player is not in the role-playing graph.

Inherited from:
IPlayer
def hasExtension[E <: AnyRef : ClassTag]: Boolean

Checks of this IPlayer has an extension of the given type. Alias for IPlayer.isPlaying.

Checks of this IPlayer has an extension of the given type. Alias for IPlayer.isPlaying.

Attributes

Inherited from:
IPlayer

Checks if this IPlayer has all of the given facet(s) attached.

Checks if this IPlayer has all of the given facet(s) attached.

Value parameters

f

the facet(s)

Attributes

Returns

true if this player has all of the given facets attached, false otherwise.

Inherited from:
IPlayer

Checks if this IPlayer has at least one of the given facets attached.

Checks if this IPlayer has at least one of the given facets attached.

Value parameters

f

the facets

Attributes

Returns

true if this player has at least one of the given facets attached, false otherwise.

Inherited from:
IPlayer
override def hashCode(): Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
IPlayer -> Any
Inherited from:
IPlayer
def isPlaying[R <: AnyRef : ClassTag]: Boolean

Checks of this IPlayer is playing a role of the given type R.

Checks of this IPlayer is playing a role of the given type R.

Type parameters

R

type of role

Attributes

Returns

true if this player is playing a role of type R, false otherwise. Returns false also, if the player is not available in the role-playing graph.

Inherited from:
IPlayer
infix def play[R <: AnyRef : ClassTag](role: R): Player[W]

Adds a play relation between core and role.

Adds a play relation between core and role.

Type parameters

R

type of role

Value parameters

role

the role that should be played

Attributes

Returns

this

Inherited from:
IPlayer
def player(using dispatchQuery: DispatchQuery): Either[TypeError, AnyRef]

Returns the player of this player instance if this is a role, or this itself.

Returns the player of this player instance if this is a role, or this itself.

Value parameters

dispatchQuery

provide this to sort the resulting instances if a role instance is played by multiple core objects

Attributes

Returns

the player of this player instance if this is a role, or this itself or an appropriate error

Inherited from:
IPlayer
infix def playing[R <: AnyRef : ClassTag](role: R): W

Adds a play relation between core and role but always returns the player instance.

Adds a play relation between core and role but always returns the player instance.

Type parameters

R

type of role

Value parameters

role

the role that should played

Attributes

Returns

the player instance

Inherited from:
IPlayer
def predecessors(): Seq[AnyRef]

Returns a list of all predecessors of this player, i.e., a transitive closure of its cores (deep roles).

Returns a list of all predecessors of this player, i.e., a transitive closure of its cores (deep roles).

Attributes

Returns

a list of all predecessors of this player

Inherited from:
IPlayer
def remove(): Unit

Removes this player from the graph.

Removes this player from the graph.

Attributes

Inherited from:
IPlayer
def roles(): Seq[AnyRef]

Returns a Seq of all roles attached to this player.

Returns a Seq of all roles attached to this player.

Attributes

Returns

a Seq of all roles of this player. Returns an empty Seq if this player is not in the role-playing graph.

Inherited from:
IPlayer
infix def transfer[R <: AnyRef : ClassTag](role: R): TransferToBuilder[R]

Transfers a role to another player.

Transfers a role to another player.

Type parameters

R

type of role

Value parameters

role

the role to transfer

Attributes

Inherited from:
IPlayer
def unary_+: Player[W]

Applies lifting to IPlayer

Applies lifting to IPlayer

Attributes

Returns

an lifted IPlayer instance with the calling object as wrapped.

Inherited from:
IPlayer

Concrete fields

override val wrapped: W