YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.SendspinGroups Class Reference

Which players are linked into whose group (the owner's decision G1 to G7 in groups.md). More...

Collaboration diagram for de.yaacc.sendspin.SendspinGroups:
Collaboration graph

Classes

enum  Result
 

Public Member Functions

synchronized Result link (String leader, String member)
 
synchronized void unlink (String member)
 Takes a member out of its group; a group that has no member left is gone.
 
synchronized void dissolve (String leader)
 Ends the group of a leader; the members are separate players again.
 
synchronized String leave (String id)
 A player stops taking part in its group (the protocol's client/leave, or a client that becomes unavailable): it is alone again and the group goes on without it.
 
synchronized void remove (String id)
 A player that is removed from the app leaves its group, or ends it if it leads one.
 
synchronized String leaderOf (String member)
 
synchronized List< String > membersOf (String leader)
 
synchronized boolean isLeader (String id)
 
synchronized boolean isInGroup (String id)
 

Static Public Member Functions

static< T > List< T > groupedOrder (List< T > sorted, java.util.function.Function< T, String > idOf, java.util.function.Function< String, String > leaderOf)
 The list with every member directly after its leader (in the order the list had), so that a group reads as one block.
 

Static Public Attributes

static final int MAX_MEMBERS = 7
 

Detailed Description

Which players are linked into whose group (the owner's decision G1 to G7 in groups.md).

A group has a leader (the card the owner linked from) and members in the order they were linked; a player is in one group at a time, a member does not lead and a leader is no member. At most MAX_MEMBERS members besides the leader (eight players in all). Not persisted. By the ids of the receivers. Pure; thread safe.

Member Function Documentation

◆ groupedOrder()

static< T > List< T > de.yaacc.sendspin.SendspinGroups.groupedOrder ( List< T > sorted,
java.util.function.Function< T, String > idOf,
java.util.function.Function< String, String > leaderOf )
static

The list with every member directly after its leader (in the order the list had), so that a group reads as one block.

A member whose leader is not in the list, and everything that is no player of a group, stays where it was. Pure.

Parameters
idOfthe receiver id of an item, null for an item that is no Sendspin player
leaderOfthe leader of the group a receiver id is a member of, null if it is none
Here is the call graph for this function:

◆ leaderOf()

synchronized String de.yaacc.sendspin.SendspinGroups.leaderOf ( String member)
Returns
the leader of the group this player is a member of, else null

Referenced by de.yaacc.player.PlayerService.getRendererPlayersOfType(), de.yaacc.sendspin.SendspinGroups.groupedOrder(), and de.yaacc.sendspin.SendspinHub.outputTargets().

Here is the caller graph for this function:

◆ leave()

synchronized String de.yaacc.sendspin.SendspinGroups.leave ( String id)

A player stops taking part in its group (the protocol's client/leave, or a client that becomes unavailable): it is alone again and the group goes on without it.

A leader leaves by ending its group, because the group is played to the leader.

Returns
the leader of the group it left (the "previous group"), or null if it was in none
Here is the call graph for this function:

◆ membersOf()

synchronized List< String > de.yaacc.sendspin.SendspinGroups.membersOf ( String leader)
Returns
the members of the group, in the order they were linked; empty if the player leads no group

Referenced by de.yaacc.sendspin.SendspinHub.groupMutedOf(), de.yaacc.sendspin.SendspinHub.groupRateOf(), de.yaacc.sendspin.SendspinHub.groupVolumeOf(), de.yaacc.sendspin.SendspinHub.link(), de.yaacc.sendspin.SendspinHub.setGroupMuted(), and de.yaacc.sendspin.SendspinHub.setGroupVolume().

Here is the caller graph for this function:

◆ unlink()

synchronized void de.yaacc.sendspin.SendspinGroups.unlink ( String member)

Takes a member out of its group; a group that has no member left is gone.

Harmless for a player that is in none.

Referenced by de.yaacc.sendspin.SendspinGroups.leave(), and de.yaacc.sendspin.SendspinGroups.remove().

Here is the caller graph for this function:

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